]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: ssl: Fix possible null deref on the SSL context in ssl_sock_to_buf()
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Sep 2026 06:25:49 +0000 (08:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Sep 2026 06:25:51 +0000 (08:25 +0200)
commita39562d6e9c3b1d20c57392eb4b66be9bc089652
tree4073f6b9981203a9d38e1ac61bf69f25d70f16b0
parent3316314ee8613bc510733b2c151715c6bdbf5981
BUG/MINOR: ssl: Fix possible null deref on the SSL context in ssl_sock_to_buf()

In ssl_sock_to_buf(), before exiting, the SSL context was systematically
dereferenced to clear SSL_SOCK_F_KTLS_RX_CTRL flag. However, at the
beginning, the SSL context is tested. So theorically, it seems possible to
enter with a NULL SSL context. So to avoid any NULL dereference, the SSL
context is now tested before clearing SSL_SOCK_F_KTLS_RX_CTRL flag

This patch should solve the issue #3465. It should be backported as far as
3.3.
src/ssl_sock.c