In the range-splitting path, create_set_item() can return NULL under
memory pressure. The result was passed directly to
ossl_list_uint_set_insert_after() without a NULL check, causing an
immediate crash. This path is reachable during normal QUIC ACK
processing under memory exhaustion.
Check the allocation result before insertion and return 0 on failure.
Fixes: c5ca718003e6 "uint_set: convert uint_set to use the list data type"
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Mar 19 19:24:09 2026
(Merged from https://github.com/openssl/openssl/pull/30490)
* handled by the above cases.
*/
y = create_set_item(end + 1, z->range.end);
+ if (y == NULL)
+ return 0;
ossl_list_uint_set_insert_after(s, z, y);
z->range.end = start - 1;
break;