]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cfgparse: improve the empty arg position report's robustness
authorWilly Tarreau <w@1wt.eu>
Mon, 12 May 2025 14:06:28 +0000 (16:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 May 2025 14:11:15 +0000 (16:11 +0200)
commitbe4d816be24255c6ba3b42284ca57085b8129e5e
treedd258f646b1cbb4638db40474920ba8f86206dc7
parent2b60e54fb1fb825a65f0668d83d912d7af873295
BUG/MINOR: cfgparse: improve the empty arg position report's robustness

OSS Fuzz found that the previous fix ebb19fb367 ("BUG/MINOR: cfgparse:
consider the special case of empty arg caused by \x00") was incomplete,
as the output can sometimes be larger than the input (due to variables
expansion) in which case the work around to try to report a bad arg will
fail. While the parse_line() function has been made more robust now in
order to avoid this condition, let's fix the handling of this special
case anyway by just pointing to the beginning of the line if the supposed
error location is out of the line's buffer.

All details here:
   https://oss-fuzz.com/testcase-detail/5202563081502720

No backport is needed unless the fix above is backported.
src/cfgparse.c