Silence gcc false positive warning on alpn_protos_len in test/handshake_helper.c
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 4 Jun 2020 10:37:50 +0000 (12:37 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Wed, 10 Jun 2020 08:43:48 +0000 (10:43 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12042)

test/handshake_helper.c

index 030073289afecc2f9c40a5fbcd85a4d41e198508..2dfded5c11983bafe3fa4fd6466ad8faf29c6de9 100644 (file)
@@ -641,7 +641,8 @@ static int configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
     }
     if (extra->client.alpn_protocols != NULL) {
         unsigned char *alpn_protos = NULL;
-        size_t alpn_protos_len;
+        size_t alpn_protos_len = 0;
+
         if (!TEST_true(parse_protos(extra->client.alpn_protocols,
                                     &alpn_protos, &alpn_protos_len))
                 /* Reversed return value convention... */