From: Tom Lane <tgl@sss.pgh.pa.us>
To: greg@turnstep.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQescapeString handling of \0
Date: Fri, 03 Oct 2003 11:31:02 -0400
Message-ID: <19872.1065195062@sss.pgh.pa.us> (raw)
In-Reply-To: <c4029001e28eb9350effc9118d391bc9@biglumber.com>
References: <c4029001e28eb9350effc9118d391bc9@biglumber.com>
greg@turnstep.com writes:
> Tom Lane wrote:
>>> Hm. Is that really the right behavior?
> Has we reached a consensus on this? I'd like to have DBD::Pg and
> PQescapeString consistent. Right now, we (DBD::Pg) are leaning toward
> the "bail if we hit \0" theory, but it would be nice to have something
> definitive in the API.
Ugly as it is, I think that we have little choice but to go with the
behavior Igor proposes (stop at \0). If we do the other then we will
have to raise the required size of the output buffer, which will
silently break existing apps (possibly creating security holes, even).
So essentially PQescapeString is going to become like strncpy --- stop
at either \0 or the given count.
This patch hasn't been applied as of 7.4b4 but I'll try to get it in
shortly.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, greg@turnstep.com
Subject: Re: PQescapeString handling of \0
In-Reply-To: <19872.1065195062@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox