]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix missing NULL check in statem_clnt_construct_test
authorNeil Horman <nhorman@openssl.org>
Tue, 21 Jul 2026 18:52:59 +0000 (14:52 -0400)
committerNorbert Pocs <norbertp@openssl.org>
Thu, 23 Jul 2026 08:24:01 +0000 (10:24 +0200)
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)

test/statem_clnt_construct_test.c

index 10f58a3ab1ac3806bf0c2c630ffba6e8cf3cabff..350e59ce2f4e937f6acf76d9bbcc5113bcb33402 100644 (file)
@@ -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;