From a2eea872d0af948e5b889083f248e270d7326be7 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 3 Aug 2026 22:47:08 +0900 Subject: [PATCH] ssl: Remove shadowed variable in write retry path Commit 5f3db0d81132 "Fix false success on zero BIO write" introduced a function-scope left variable while the app-buffer recovery block already declared one. This breaks builds using -Werror=shadow. Assign the current buffer length to the existing function-scope variable in the recovery block. This preserves the previous re-read at that point while eliminating the shadowed declaration. Fixes: 5f3db0d81132 "Fix false success on zero BIO write" Reviewed-by: Viktor Dukhovni Reviewed-by: Andrew Dinh Reviewed-by: Jakub Zelenka Reviewed-by: Eugene Syromiatnikov MergeDate: Mon Aug 3 15:46:22 2026 (Merged from https://github.com/openssl/openssl/pull/32153) --- ssl/record/methods/tls_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c index 36304496e83..f895f942a66 100644 --- a/ssl/record/methods/tls_common.c +++ b/ssl/record/methods/tls_common.c @@ -1924,9 +1924,9 @@ int tls_retry_write_records(OSSL_RECORD_LAYER *rl) */ if (TLS_BUFFER_is_app_buffer(thiswb) && (rl->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER) != 0) { - size_t left = TLS_BUFFER_get_left(thiswb); unsigned char *buf; + left = TLS_BUFFER_get_left(thiswb); buf = OPENSSL_malloc(left); if (buf == NULL) { RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); -- 2.47.3