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