Re: prevent invalidly encoded input - Mailing list pgsql-patches

From Tom Lane
Subject Re: prevent invalidly encoded input
Date
Msg-id 15042.1189533969@sss.pgh.pa.us
Whole thread Raw
In response to prevent invalidly encoded input  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: prevent invalidly encoded input
List pgsql-patches
Andrew Dunstan <andrew@dunslane.net> 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 via chr(), convert() and
> possibly other functions, but these two paths are the biggest holes that
> need plugging.

The COPY code looks sane.  On the scan.l change, I believe two out of
three of those calls are useless, because we do not do backslash
processing in dollar-quoted strings nor in quoted identifiers.
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.

            regards, tom lane

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: prevent invalidly encoded input
Next
From: "Marshall, Steve"
Date:
Subject: PL/TCL Patch to prevent postgres from becoming multithreaded