]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/quic-openssl-docker/hq-interop/quic-hq-interop.c: Add check for OPENSSL_zalloc()
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Thu, 26 Jun 2025 19:23:42 +0000 (19:23 +0000)
committerTomas Mraz <tomas@openssl.org>
Tue, 1 Jul 2025 18:49:47 +0000 (20:49 +0200)
Add check for the return value of OPENSSL_zalloc() to avoid potential NULL pointer dereference.

Fixes: 2858149e44 ("Adding an hq-interop alpn client")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27915)

test/quic-openssl-docker/hq-interop/quic-hq-interop.c

index 14375d178a77b3cfd98efd03ecac81b6a6e314b9..823f1165a3ff876fbfe92eb6ae71728cbf1fc2b9 100644 (file)
@@ -883,6 +883,11 @@ int main(int argc, char *argv[])
         goto end;
     }
 
+    if (reqnames == NULL) {
+        fprintf(stderr, "Failed to allocate memory for request names\n");
+        goto end;
+    }
+
     hostname = argv[argnext++];
     port = argv[argnext++];
     reqfile = argv[argnext];