From: Willy Tarreau Date: Sun, 16 Feb 2014 07:20:13 +0000 (+0100) Subject: BUG/MEDIUM: config: immediately abort if peers section has no name X-Git-Tag: v1.5-dev23~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5498472ec0421eea77992c70d560828a6153df6e;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: config: immediately abort if peers section has no name Cyril Bonté reported that despite commit 0dbbf317 which attempted to fix the crash when a peers section has no name, we still get a segfault after the error message when parsing the peers. The reason is that the returned error code is ERR_FATAL and not ERR_ABORT, so the parsing continues while the section was not initialized. This is 1.5-specific, no backport is needed. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 88231f9535..a24eda8aa6 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1543,7 +1543,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) if (strcmp(args[0], "peers") == 0) { /* new peers section */ if (!*args[1]) { Alert("parsing [%s:%d] : missing name for peers section.\n", file, linenum); - err_code |= ERR_ALERT | ERR_FATAL; + err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -1551,7 +1551,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) if (err) { Alert("parsing [%s:%d] : character '%c' is not permitted in '%s' name '%s'.\n", file, linenum, *err, args[0], args[1]); - err_code |= ERR_ALERT | ERR_FATAL; + err_code |= ERR_ALERT | ERR_ABORT; goto out; }