On Thu, Nov 26, 2026 at 08:48:01AM -0800, Diego wrote:
> v3 [1] is two patches:
> 
> - 0001 fixes a gap in how libpq clears a password read from the
>   password file.  passwordFromFile() does strdup() on the rest of the
>   line and then de-escapes the password in place, so the tail of an
>   escaped password, and any fields after it, are left in the
>   allocation past the terminator, out of reach of the
>   explicit_bzero(p, strlen(p)) in pqReleaseConnHosts().  It is +21/-9
>   in fe-connect.c and does not depend on the new API.

Hmm, yeah, I guess that you are right here and that this leaks useless
data in the stack.  One could argue about a backpatch but this is
close to explicit_bzero() in spirit even, so let's do so as an
improvement.  I don't see a point in complicating the comment the way
you are suggesting: this explains a non-consequence.  Or just simplify
the comment to a simpler "De-escape the buffer, before copying it into
the result.".

I am not planning to spend cycles on your 0002, though.  (Perhaps
others will be interested in that.)

> Is there anything I can do to make this easier to pick up?  If the API
> needs more discussion, 0001 can go in on its own, and I can move it to
> a separate thread if that helps.

One suggestion: you could help other people.  If you are using some
AI-generated content, which I think is at least partially the case, a
second suggestion is to slow down with the noise and the quantity of
text in your messages or patches.

> Michael, I added you in Cc because you reworked the error handling in
> passwordFromFile() last year (861af926103).

For a completely unrelated thing.  But thanks anyway.  :)
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to