]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tools: only fill first empty arg when not out of range
authorWilly Tarreau <w@1wt.eu>
Wed, 7 May 2025 05:22:24 +0000 (07:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 May 2025 05:25:29 +0000 (07:25 +0200)
commit10e6d0bd5702586a11daf8bd320713e0b501e37d
treeaddffdcbd27cc90f2dee1a2022450853f4165710
parentfbceabbccf61c3869c71c6d6494c155718076a78
BUG/MINOR: tools: only fill first empty arg when not out of range

In commit 3f2c8af313 ("MINOR: tools: make parse_line() provide hints
about empty args") we've added the ability to record the position of
the first empty arg in parse_line(), but that check requires to
access the args[] array for the current arg, which is not valid in
case we stopped on too large an argument count. Let's just check the
arg's validity before doing so.

This was reported by OSS Fuzz:
  https://issues.oss-fuzz.com/issues/415850462

No backport is needed since this was in the latest dev branch.
src/tools.c