Fix check for 'outlen' return from SSL_select_next_proto()
authorHeikki Linnakangas <[email protected]>
Mon, 8 Apr 2024 02:03:17 +0000 (05:03 +0300)
committerHeikki Linnakangas <[email protected]>
Mon, 8 Apr 2024 02:03:17 +0000 (05:03 +0300)
Fixes compiler warning reported by Andres Freund.

Discusssion: https://www.postgresql.org/message-id/20240408015055[email protected]

src/backend/libpq/be-secure-openssl.c

index 6e877c017313af5dc276be7907492c930b8f7366..29c9af1aabfa02cc9aaa1d37d2160c9c3973c87f 100644 (file)
@@ -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)