]> git.kaiwu.me - nginx.git/commit
QUIC: improved error handling in OpenSSL compat layer.
authoruser.email <123011167+lukefr09@users.noreply.github.com>
Tue, 24 Feb 2026 01:33:57 +0000 (19:33 -0600)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Tue, 24 Mar 2026 18:33:23 +0000 (22:33 +0400)
commit3986410e12e2b1abc81965dd96598d4c2dd02b00
tree8cd86001ae510690e8dbaa3278b98e3b311caa1d
parent0fa49c5f7fa03c628c887fe69acbd7da0ec4e585
QUIC: improved error handling in OpenSSL compat layer.

Previously ngx_quic_compat_create_record() could try to encrypt a TLS
record even if encryption context was missing, which resulted in a NULL
pointer dereference.

The context is created by ngx_quic_compat_set_encryption_secret() called
from the OpenSSL keylog callback.  If an error occurred in that function,
the context could remain missing.  This could happen under memory pressure,
if an allocation failed inside this function.

The fix is to handle errors from ngx_quic_compat_set_encryption_secret()
and set qc->error to trigger an error after SSL_do_handshake() return.
Also, a check for context is added to ngx_quic_compat_create_record()
to avoid other similar issues.
src/event/quic/ngx_event_quic_openssl_compat.c