From: Pauli Date: Sun, 18 Sep 2022 23:57:38 +0000 (+1000) Subject: Coverity 1515415: NULL dereference X-Git-Tag: openssl-3.2.0-alpha1~2054 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82d46d14462491681f25d016508715e85c1dc4d1;p=thirdparty%2Fopenssl.git Coverity 1515415: NULL dereference Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19236) --- diff --git a/test/helpers/ssltestlib.c b/test/helpers/ssltestlib.c index 9dca5e8363b..65077a2d1d8 100644 --- a/test/helpers/ssltestlib.c +++ b/test/helpers/ssltestlib.c @@ -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)