pgsql: Clean up secure_read()/secure_write() return type - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Clean up secure_read()/secure_write() return type
Date
Msg-id E1wjtED-000FxW-2i@gemulon.postgresql.org
Whole thread
List pgsql-committers
Clean up secure_read()/secure_write() return type

The return type is ssize_t, not int, but some callers didn't handle
this properly.

The BIO callbacks are constrained by the OpenSSL API, so they take int
for the length and return int.  This is safe, since the return value
can't be greater than the input length.  To make it more clear that
this is intentional, cast the result of the
secure_read()/secure_write() call to int explicitly.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://www.postgresql.org/message-id/flat/f9aab072-0078-49e4-ab93-3b08086a4406@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7d45a6dc19743d999f5c83c95ad144a0f2eb6745

Modified Files
--------------
src/backend/libpq/be-secure-openssl.c    | 4 ++--
src/backend/libpq/pqcomm.c               | 6 +++---
src/interfaces/libpq/fe-misc.c           | 4 ++--
src/interfaces/libpq/fe-secure-openssl.c | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Rework pgstat_write_statsfile() in combination with to_serialize
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Clean up read() return type