Clear alpn_selected_len for clients, too
authorBenjamin Kaduk <bkaduk@akamai.com>
Wed, 15 Mar 2017 00:17:15 +0000 (19:17 -0500)
committerRichard Levitte <levitte@openssl.org>
Wed, 15 Mar 2017 02:18:01 +0000 (03:18 +0100)
Zero out the length alongside the NULLing of the pointer, to
bring parity between the selected and proposed fields..

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2954)

ssl/statem/extensions.c

index ffacd41cf91d77b80c81f8cf5d97107fcf78716d..0ab1f0494c07babccb6b8c94fa7faa271f2e0772 100644 (file)
@@ -875,8 +875,8 @@ static int init_alpn(SSL *s, unsigned int context)
 {
     OPENSSL_free(s->s3->alpn_selected);
     s->s3->alpn_selected = NULL;
+    s->s3->alpn_selected_len = 0;
     if (s->server) {
-        s->s3->alpn_selected_len = 0;
         OPENSSL_free(s->s3->alpn_proposed);
         s->s3->alpn_proposed = NULL;
         s->s3->alpn_proposed_len = 0;