Commit d6d07e77cf for openssl.org

commit d6d07e77cf485628ddfcdc916d71499fdba80be5
Author: Norbert Pocs <norbertp@openssl.org>
Date:   Fri Sep 4 08:43:05 2026 +0200

    Don't cleanup uninitialised variable hdr

    Fixes coverity issues 1700551.

    Signed-off-by: Norbert Pocs <norbertp@openssl.org>
    Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
    Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
    Merge-date: Tue Sep 15 10:14:43 2026
    Merged-from: https://github.com/openssl/openssl/pull/32677

diff --git a/ssl/record/methods/tls1_meth.c b/ssl/record/methods/tls1_meth.c
index 85efe631a4..94d4b6879b 100644
--- a/ssl/record/methods/tls1_meth.c
+++ b/ssl/record/methods/tls1_meth.c
@@ -175,8 +175,9 @@ static int setup_record_header(const OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec,
     WPACKET hdr;
     size_t hdrsize;

-    if (buflen < EVP_AEAD_TLS1_AAD_LEN
-        || !WPACKET_init_static_len(&hdr, buf, EVP_AEAD_TLS1_AAD_LEN, 0)
+    if (buflen < EVP_AEAD_TLS1_AAD_LEN)
+        return 0;
+    if (!WPACKET_init_static_len(&hdr, buf, EVP_AEAD_TLS1_AAD_LEN, 0)
         || (rl->isdtls && !WPACKET_put_bytes_u16(&hdr, rl->epoch))
         || (rl->isdtls ? !WPACKET_put_bytes_u48(&hdr, rl->sequence)
                        : !WPACKET_put_bytes_u64(&hdr, rl->sequence))