]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tools: always terminate empty lines
authorWilly Tarreau <w@1wt.eu>
Mon, 5 May 2025 15:33:22 +0000 (17:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 May 2025 15:33:22 +0000 (17:33 +0200)
commit09a325a4de4aedd8d7d366769d4dd7c5d9a44f25
tree16633e3f0576e61686d1b3af41e8e3fb4235a2d2
parent08d3caf30eefbc41f324e307ee8e62a319abfd0f
BUG/MINOR: tools: always terminate empty lines

Since latest commit 7e4a2f39ef ("BUG/MINOR: tools: do not create an empty
arg from trailing spaces"), an empty line will no longer produce an arg
and no longer append a trailing zero to them. This was not visible because
one is already present in the input string, however all the trailing args
are set to out+outpos-1, which now points one char before the buffer since
nothing was emitted, and was noticed by ASAN, and/or when parsing garbage.
Let's make sure to always emit the zero for empty lines as well to address
this issue. No backport is needed unless the patch above gets backported.
src/tools.c