BUG/MINOR: server: Don't call fopen() with server-state filepath set to NULL
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Feb 2021 15:31:03 +0000 (16:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Feb 2021 09:23:25 +0000 (10:23 +0100)
commitacef6b9984c6877e162d181536235dade1860396
treef9d9dea88fd5033304f029b02d3780a2d16a1025
parenta3201bc5dbf5a837cbd9c25d0c795868f236871a
BUG/MINOR: server: Don't call fopen() with server-state filepath set to NULL

When a local server-state file is loaded, if its name is too long, the error
is not properly handled, resulting to a call to fopen() with the "filepath"
variable set to NULL. To fix the bug, when this error occurs, we jump to the
next proxy, via a "continue" statement. And we take case to set "filepath"
variable after the error handling to be sure.

This patch should fix the issue #1111. It must be backported as far as 1.6.

(cherry picked from commit 8952ea636b03fceb44c8172c4d9725a393e9146d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/server.c