]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cfgparse: consider the special case of empty arg caused by \x00
authorWilly Tarreau <w@1wt.eu>
Fri, 9 May 2025 07:55:39 +0000 (09:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 May 2025 08:01:44 +0000 (10:01 +0200)
commitebb19fb367e301869dd9a3ee7ea03e9c975ede0b
tree47535bfb3c011af80c7b3bfeafc1373acce54f00
parent3fdb039a99cdee543f4bbbfc983a51eb18f7f1f0
BUG/MINOR: cfgparse: consider the special case of empty arg caused by \x00

The reporting of the empty arg location added with commit 08d3caf30
("MINOR: cfgparse: visually show the input line on empty args") falls
victim of a special case detected by OSS Fuzz:

     https://issues.oss-fuzz.com/issues/415850462

In short, making an argument start with "\x00" doesn't make it empty for
the parser, but still emits an empty string which is detected and
displayed. Unfortunately in this case the error pointer is not set so
the sanitization function crashes.

What we're doing in this case is that we fall back to the position of
the output argument as an estimate of where it was located in the input.
It's clearly inexact (quoting etc) but will still help the user locate
the problem.

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