]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Coverity 1515415: NULL dereference
authorPauli <pauli@openssl.org>
Sun, 18 Sep 2022 23:57:38 +0000 (09:57 +1000)
committerHugo Landau <hlandau@openssl.org>
Wed, 21 Sep 2022 13:15:53 +0000 (14:15 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19236)

test/helpers/ssltestlib.c

index 9dca5e8363bd5281c2c0c7dbdfe025f31ae05794..65077a2d1d866ec4045b1f8bd171c15aa0c2abd1 100644 (file)
@@ -587,7 +587,8 @@ int mempacket_test_inject(BIO *bio, const char *in, int inl, int pktnum,
     }
 
     for (i = 0; i < sk_MEMPACKET_num(ctx->pkts); i++) {
-        looppkt = sk_MEMPACKET_value(ctx->pkts, i);
+        if (!TEST_ptr(looppkt = sk_MEMPACKET_value(ctx->pkts, i)))
+            goto err;
         /* Check if we found the right place to insert this packet */
         if (looppkt->num > thispkt->num) {
             if (sk_MEMPACKET_insert(ctx->pkts, thispkt, i) == 0)