From: Niels Dossche Date: Thu, 21 Aug 2025 11:24:01 +0000 (+0200) Subject: Fix reallocation failure condition in qtx_resize_txe() X-Git-Tag: openssl-3.6.0-alpha1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=220f5be6908631759d56c7a6458be8385d984260;p=thirdparty%2Fopenssl.git Fix reallocation failure condition in qtx_resize_txe() Returning the same pointer does not mean that the reallocation failed, it would also prevent updating alloc_len down below. This is similar code and a similar change to 043a41ddee. Reviewed-by: Saša Nedvědický Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28317) --- diff --git a/ssl/quic/quic_record_tx.c b/ssl/quic/quic_record_tx.c index e902113fb98..1e18f7962fe 100644 --- a/ssl/quic/quic_record_tx.c +++ b/ssl/quic/quic_record_tx.c @@ -279,12 +279,12 @@ static TXE *qtx_resize_txe(OSSL_QTX *qtx, TXE_LIST *txl, TXE *txe, size_t n) * data. */ txe2 = OPENSSL_realloc(txe, sizeof(TXE) + n); - if (txe2 == NULL || txe == txe2) { + if (txe2 == NULL) { if (p == NULL) ossl_list_txe_insert_head(txl, txe); else ossl_list_txe_insert_after(txl, p, txe); - return txe2; + return NULL; } if (p == NULL)