pgsql: libpq: Make error checks in the new buffer draining code more ro - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: libpq: Make error checks in the new buffer draining code more ro
Date
Msg-id E1whr22-000JbO-18@gemulon.postgresql.org
Whole thread
List pgsql-committers
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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/56988064bcaf91c9526e2b42b19228fc48fff539

Modified Files
--------------
src/interfaces/libpq/fe-misc.c   | 11 ++++++++---
src/interfaces/libpq/fe-secure.c |  5 +++--
2 files changed, 11 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: pgsql: Refactor how some aux processes advertise their ProcNumber
Next
From: Nathan Bossart
Date:
Subject: pgsql: Remove WaitEventCustomCounterData.