BUG/MEDIUM: config: Reset outline buffer size on realloc error in readcfgfile()

When the line parsing failed because outline buffer must be reallocated, if
my_realloc2() call fails, the buffer size must be reset. Indeed, in this case
the current line is skipped, a fatal error is reported and we jump to the next
line. At this stage the outline buffer is NULL. If the buffer size is not reset,
the next call to parse_line() crashes because we try to write in the buffer. We
fail to detect the outline buffer is too small to copy any character.

To fix the issue, outlinesize variable must be set to 0 when outline allocation
failed.

This patch should fix the issue #1563. It must be backported as far as 2.2.

(cherry picked from commit dfe32c7e15f1fd8d6df51b807cb2b825fd2f85a0)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 693e644659f20c4908c9c2416fdabaf8bc5229c8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed