Re: [PATCHES] prevent invalidly encoded input

2007-09-12 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > > addlitchar(unescape_single_char(yytext[1])); > + if > (IS_HIGHBIT_SET(literalbuf[literallen])) > + saw_high_bit = true; Isn't that

Re: [PATCHES] prevent invalidly encoded input

2007-09-11 Thread Andrew Dunstan
Tom Lane wrote: So it looks like you need to recheck if unescape_single_char sees a high-bit-set char. You should take a second look at the COPY code to see if there's a similar case there --- I forget what it does with backslash followed by non-digit. It's covered. Revised patch attach

Re: [PATCHES] prevent invalidly encoded input

2007-09-11 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Also, I'd kinda like to have the check-for-high-bit optimization in >> scan.l too --- some people do throw big literals at the thing. >> > OK, will do. Am I correct in thinking I don't need to worry about the > case, only the and

Re: [PATCHES] prevent invalidly encoded input

2007-09-11 Thread Andrew Dunstan
Tom Lane wrote: Also, I'd kinda like to have the check-for-high-bit optimization in scan.l too --- some people do throw big literals at the thing. OK, will do. Am I correct in thinking I don't need to worry about the case, only the and cases? cheers andrew -

Re: [PATCHES] prevent invalidly encoded input

2007-09-11 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Attached is a patch to the scanner and the COPY code that checks for > invalidly encoded data that can currently leak into our system via \ > escapes in quoted literals or text mode copy fields, as recently > discussed. That would still leave holes vi