diff options
author | 2020-09-09 12:31:23 +0000 | |
---|---|---|
committer | 2020-09-09 12:31:23 +0000 | |
commit | eef1bcf28fbc5bbca30f8b5490ec2bf15c0b9f72 (patch) | |
tree | 6b6b0251cdb694d60e1fcc85695f247f79a3203f /lib | |
parent | Import latest OPENSSL_NO_* flags from OpenSSL 1.1.1g (diff) | |
download | wireguard-openbsd-eef1bcf28fbc5bbca30f8b5490ec2bf15c0b9f72.tar.xz wireguard-openbsd-eef1bcf28fbc5bbca30f8b5490ec2bf15c0b9f72.zip |
Set alpn_selected_len = 0 when alpn_selected is NULL
ok jsing@ tb@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/ssl_tlsext.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libssl/ssl_tlsext.c b/lib/libssl/ssl_tlsext.c index f3078f3efe5..a039d0b10a4 100644 --- a/lib/libssl/ssl_tlsext.c +++ b/lib/libssl/ssl_tlsext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_tlsext.c,v 1.81 2020/08/03 19:46:55 tb Exp $ */ +/* $OpenBSD: ssl_tlsext.c,v 1.82 2020/09/09 12:31:23 inoguchi Exp $ */ /* * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> @@ -91,6 +91,7 @@ tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert) if (r == SSL_TLSEXT_ERR_OK) { free(S3I(s)->alpn_selected); if ((S3I(s)->alpn_selected = malloc(selected_len)) == NULL) { + S3I(s)->alpn_selected_len = 0; *alert = SSL_AD_INTERNAL_ERROR; return 0; } @@ -2193,6 +2194,7 @@ tlsext_server_reset_state(SSL *s) S3I(s)->renegotiate_seen = 0; free(S3I(s)->alpn_selected); S3I(s)->alpn_selected = NULL; + S3I(s)->alpn_selected_len = 0; s->internal->srtp_profile = NULL; } @@ -2218,6 +2220,7 @@ tlsext_client_reset_state(SSL *s) S3I(s)->renegotiate_seen = 0; free(S3I(s)->alpn_selected); S3I(s)->alpn_selected = NULL; + S3I(s)->alpn_selected_len = 0; } int |