From: Heikki Linnakangas Date: Mon, 8 Apr 2024 02:03:17 +0000 (+0300) Subject: Fix check for 'outlen' return from SSL_select_next_proto() X-Git-Tag: REL_17_BETA1~328 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=3e60e956b0017ae9d329bf242e76c4487fb39b4d;p=postgresql.git Fix check for 'outlen' return from SSL_select_next_proto() Fixes compiler warning reported by Andres Freund. Discusssion: https://www.postgresql.org/message-id/20240408015055.xsuahullywpfwyvu@awork3.anarazel.de --- diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 6e877c01731..29c9af1aabf 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -1324,7 +1324,7 @@ alpn_cb(SSL *ssl, retval = SSL_select_next_proto((unsigned char **) out, outlen, alpn_protos, sizeof(alpn_protos), in, inlen); - if (*out == NULL || *outlen > sizeof(alpn_protos) || outlen <= 0) + if (*out == NULL || *outlen > sizeof(alpn_protos) || *outlen <= 0) return SSL_TLSEXT_ERR_NOACK; /* can't happen */ if (retval == OPENSSL_NPN_NEGOTIATED)