]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: ssl-hello: make use of the null-terminated servername
authorWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 07:23:48 +0000 (09:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 11:13:24 +0000 (13:13 +0200)
commitc41c731f5e0048ff9d79b5f2b009e0a53cafb6ef
tree52376d4b855622d6af9847d0790fbb6d9af537ae
parent2653936510002991841eb1abcef5c24e0588346f
BUG/MINOR: ssl-hello: make use of the null-terminated servername

In ssl_sock_switchctx_cbk(), the servername is copied into the trash
and null-terminated, but later in the call to strncpy() it's still used
as-is, so anything that follows it will be copied as well, which is not
really expected. Let's make the servername point to the trash after
sanitizing it, like ssl_sock_switchcbk_wolfSSL_cbk() does.

This can be backported to 2.6 since it was introduced with commit
a996763619 ("BUG/MINOR: ssl: Store client SNI in SSL context in case
of ClientHello error").
src/ssl_clienthello.c