]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix NULL check in bring_oscp_resp_in_correct_order
authorNeil Horman <nhorman@openssl.org>
Sat, 26 Jul 2025 13:18:11 +0000 (09:18 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 29 Jul 2025 17:40:57 +0000 (13:40 -0400)
We assign an allocated pointer to *sk_resp but only check if sk_resp is
NULL when sk_resp is a pointer to a pointer

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

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28101)

apps/s_server.c

index d23e5defa518739ddeca4572ec7e2089257600b6..c09395c69b231fb27289f06e35e159aaf9945c15 100644 (file)
@@ -635,7 +635,7 @@ static int bring_ocsp_resp_in_correct_order(SSL *s, tlsextstatusctx *srctx,
     /* reserve enough space so the pushes to the stack would not fail */
     *sk_resp = sk_OCSP_RESPONSE_new_reserve(NULL, num);
 
-    if (sk_resp == NULL)
+    if (*sk_resp == NULL)
         return SSL_TLSEXT_ERR_ALERT_FATAL;
 
     for (i = 0; i < num; i++) {