Commit 04cf7eb7b9 for openssl.org
commit 04cf7eb7b96cc37d05263d78bd2c0726b0c840e4
Author: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Date: Wed May 20 19:11:40 2026 +0200
ssl/quic/quic_ackm.c: fix unhandled memory failure in tx pkt history map insert
This can cause error when freeing txpim as it can be still in use so the
assert in it fails.
Fixes: fa4e92a70a5f "QUIC ACK Manager, Statistics Manager and Congestion Control API"
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue May 26 09:59:05 2026
(Merged from https://github.com/openssl/openssl/pull/31258)
diff --git a/ssl/quic/quic_ackm.c b/ssl/quic/quic_ackm.c
index 503a6eae19..3d419c478b 100644
--- a/ssl/quic/quic_ackm.c
+++ b/ssl/quic/quic_ackm.c
@@ -117,6 +117,8 @@ tx_pkt_history_add_actual(struct tx_pkt_history_st *h,
return 0;
lh_OSSL_ACKM_TX_PKT_insert(h->map, pkt);
+ if (lh_OSSL_ACKM_TX_PKT_error(h->map))
+ return 0;
ossl_list_tx_history_insert_tail(&h->packets, pkt);
return 1;