diff options
author | Pauli <pauli@openssl.org> | 2022-09-19 09:57:38 +1000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-09-21 14:16:47 +0100 |
commit | 33796db4a5c3ea68ae80530dcbff60222c5a2008 (patch) | |
tree | 7cc1b871de216f9a8d50411ef15216fdceee86ce | |
parent | ff9b1fe302c2c5022f35ad3b78f05080ff4908da (diff) |
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)
(cherry picked from commit 82d46d14462491681f25d016508715e85c1dc4d1)
-rw-r--r-- | test/helpers/ssltestlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/helpers/ssltestlib.c b/test/helpers/ssltestlib.c index 24df80e0e9..51740f3599 100644 --- a/test/helpers/ssltestlib.c +++ b/test/helpers/ssltestlib.c @@ -504,7 +504,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) |