]> 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:41 +0000 (18:36 +0300)
commit7532f2117c4e422ca08896473689f589309219c3
tree2ba28a2ba086a8febb44a017a6ef00f124d1bf59
parentf5f569713b871ca6771e6fbaf5d4de16d4df1728
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