From 1b3527dfd5e77173a43e4ffe1a82cb048519a5b8 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 15 Aug 2022 10:46:53 +0000 Subject: [PATCH] Avoid shadowing the cbs function parameter in tlsext_alpn_server_parse() ok jsing --- lib/libssl/ssl_tlsext.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/libssl/ssl_tlsext.c b/lib/libssl/ssl_tlsext.c index f417f59b8e7..a42856264b3 100644 --- a/lib/libssl/ssl_tlsext.c +++ b/lib/libssl/ssl_tlsext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_tlsext.c,v 1.128 2022/08/04 09:27:36 tb Exp $ */ +/* $OpenBSD: ssl_tlsext.c,v 1.129 2022/08/15 10:46:53 tb Exp $ */ /* * Copyright (c) 2016, 2017, 2019 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -86,7 +86,7 @@ tlsext_alpn_check_format(CBS *cbs) static int tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert) { - CBS alpn; + CBS alpn, selected_cbs; const unsigned char *selected; unsigned char selected_len; int r; @@ -111,11 +111,9 @@ tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert) s->ctx->internal->alpn_select_cb_arg); if (r == SSL_TLSEXT_ERR_OK) { - CBS cbs; + CBS_init(&selected_cbs, selected, selected_len); - CBS_init(&cbs, selected, selected_len); - - if (!CBS_stow(&cbs, &s->s3->alpn_selected, + if (!CBS_stow(&selected_cbs, &s->s3->alpn_selected, &s->s3->alpn_selected_len)) { *alert = SSL_AD_INTERNAL_ERROR; return 0; -- 2.20.1