Coverity 1515415: NULL dereference

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19236)
This commit is contained in:
Pauli 2022-09-19 09:57:38 +10:00 committed by Hugo Landau
parent 1cef04091a
commit 82d46d1446

View 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)