Appease gcc's Wmaybe-uninitialized
authorEmilia Kasper <emilia@openssl.org>
Thu, 15 Oct 2015 11:27:55 +0000 (13:27 +0200)
committerEmilia Kasper <emilia@openssl.org>
Thu, 15 Oct 2015 14:19:00 +0000 (16:19 +0200)
False positive: gcc (4.8) can't figure out the SSL_IS_DTLS logic.

Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl/s3_srvr.c

index ca11c6e8b388d8606ff8f654d82ac5e556b5d48d..7bf5828ad38ae04987dbb9a386c8683bccc69c04 100644 (file)
@@ -883,6 +883,7 @@ int ssl3_get_client_hello(SSL *s)
 
     is_v2_record = RECORD_LAYER_is_sslv2_record(&s->rlayer);
 
+    PACKET_null_init(&cookie);
     /* First lets get s->client_version set correctly */
     if (is_v2_record) {
         unsigned int version;
@@ -1052,8 +1053,6 @@ int ssl3_get_client_hello(SSL *s)
 
         PACKET_null_init(&compression);
         PACKET_null_init(&extensions);
-        /* We're never DTLS here but just play safe and initialize. */
-        PACKET_null_init(&cookie);
     } else {
         /* Regular ClientHello. */
         if (!PACKET_copy_bytes(&pkt, s->s3->client_random, SSL3_RANDOM_SIZE)