]> 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:12 +0000 (18:35 +0300)
commit87c3a79ea206410f34f326eb63c36d8679edeb8b
tree102da4d37d64ee84bae5ff2d5e878cbb07e29fd3
parent27761c0151b3b9b57e58597fa027a26619c9608e
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