Commit 05b241cb09 for openssl.org

commit 05b241cb094941c7f83ebd94d5516648d82bc2d9
Author: Neil Horman <nhorman@openssl.org>
Date:   Tue Jul 21 14:52:59 2026 -0400

    Fix missing NULL check in statem_clnt_construct_test

    Fixes https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1695905

    Reviewed-by: Milan Broz <mbroz@openssl.org>
    Reviewed-by: Andrew Dinh <andrewd@openssl.org>
    Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
    Reviewed-by: Norbert Pocs <norbertp@openssl.org>
    MergeDate: Thu Jul 23 08:24:25 2026
    (Merged from https://github.com/openssl/openssl/pull/31992)

diff --git a/test/statem_clnt_construct_test.c b/test/statem_clnt_construct_test.c
index 10f58a3ab1..350e59ce2f 100644
--- a/test/statem_clnt_construct_test.c
+++ b/test/statem_clnt_construct_test.c
@@ -129,7 +129,8 @@ static int finish_msg(SSL *ssl, WPACKET *pkt, int mt, unsigned char **msg,
 {
     SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL(ssl);

-    if (!TEST_true(ssl_close_construct_packet(s, pkt, mt))
+    if (!TEST_ptr(s)
+        || !TEST_true(ssl_close_construct_packet(s, pkt, mt))
         || !TEST_true(WPACKET_get_total_written(pkt, msglen))
         || !TEST_true(WPACKET_finish(pkt)))
         return 0;