]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: mworker: always initialize the saveptr of strtok_r()
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Dec 2024 11:10:13 +0000 (12:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Dec 2024 11:18:46 +0000 (12:18 +0100)
commit21df7677a993e5a9e6d170dd98b70a1d2801958e
treef19d3ffc9ffbecc0d1143d0b55313b58f816995f
parentf78121dd32d14834eaa59c1f5eb610a49154be14
BUILD: mworker: always initialize the saveptr of strtok_r()

Building with some libcs which define strtok_r() as an inline function
can yield a possibly uninitialized warning due to a loop dereferencing
this save pointer early, even though the doc clearly mentions that it
is ignored. This is actually more of a mismatch between the compiler
and the libc (gcc-4.7 and glibc-2.23 in that case). It's trivial to
set s2 to NULL here so let's do it to please this old couple. Note
that while the warning is triggered in all supported versions, there's
no point backporting it since it's unlikely this combination will be
relevant outside of backwards compatibility checks now.
src/mworker.c