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:34:00 +0000 (12:34 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Wed, 10 Jun 2020 08:39:26 +0000 (10:39 +0200)
Fixes #12033

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/12041)

test/handshake_helper.c

index 1742004b5b80699793e4da574996ce01ec5011e1..347f6b49eddaa7eb84bb4c9fd02098bcb46cee77 100644 (file)
@@ -637,7 +637,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... */