BUG/MINOR: cfgparse: correctly deal with empty lines
authorWilly Tarreau <w@1wt.eu>
Fri, 26 Jun 2020 15:24:54 +0000 (17:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 26 Jun 2020 15:24:54 +0000 (17:24 +0200)
commit08488f66b6028761d8eb60a3bddb9aa080a2af4a
tree645978857a1476056202129e076880e95b0d8edf
parentc184d875586a0ff383d1f654b8004fbb383e4649
BUG/MINOR: cfgparse: correctly deal with empty lines

Issue 23653 in oss-fuzz reports a heap overflow bug which is in fact a
bug introduced by commit 9e1758efb ("BUG/MEDIUM: cfgparse: use
parse_line() to expand/unquote/unescape config lines") to address
oss-fuzz issue 22689, which was only partially fixed by commit 70f58997f
("BUG/MINOR: cfgparse: Support configurations without newline at EOF").

Actually on an empty line, end == line so we cannot dereference end-1
to check for a trailing LF without first being sure that end is greater
than line.

No backport is needed, this is 2.2 only.
src/cfgparse.c