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.2.6~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb0ea01938452c9387d171f124c0f26710c3f890;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) (cherry picked from commit 220f5be6908631759d56c7a6458be8385d984260) --- diff --git a/ssl/quic/quic_record_tx.c b/ssl/quic/quic_record_tx.c index 37e829495b4..2daf72293cf 100644 --- a/ssl/quic/quic_record_tx.c +++ b/ssl/quic/quic_record_tx.c @@ -261,12 +261,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)