]> 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:36:18 +0000 (18:36 +0300)
commit5ba13f8c0488feefac4115e4efd22b522c983b21
tree7076efb52f507b1e49c6b299bacef22af309f38e
parent21a6c69eaadeca5f2bdd46803f2178cc44c4786e
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