]> git.ipfire.org Git - thirdparty/postgresql.git/commit
libpq: Make error checks in the new buffer draining code more robust
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 9 Jul 2026 15:34:27 +0000 (18:34 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 9 Jul 2026 15:35:24 +0000 (18:35 +0300)
commitbab0a2db733502da5663c5aef38976cbf8711707
treee530ee48acc645409fc59db92f39e51de1eed781
parent0958c3ea4c677e9f5900fbdc60458f5b9bb34a06
libpq: Make error checks in the new buffer draining code more robust

Check explicitly for pqsecure_read() returning an error. It shouldn't
fail, and we would've caught it in the check for a short read, but
better to be explicit so that the error message is more informative.
We also shouldn't update 'inEnd' when the read fails, although that
too is just pro forma as we will bail out and close the connection on
error.

Reported-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/34844e8c-267c-4daf-b1e0-f26059a4a7d3@eisentraut.org
Backpatch-through: 14
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-secure.c