From: Willy Tarreau Date: Fri, 27 Jul 2018 08:26:22 +0000 (+0200) Subject: BUG/MINOR: config: stick-table is not supported in defaults section X-Git-Tag: v1.9-dev1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c786768dbaa178a2b9ad82eebf004eb3e541201d;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: stick-table is not supported in defaults section Thierry discovered that the following config crashes haproxy while parsing the config (it's probably the smallest crasher) : defaults stick-table type ip size 1M And indeed it does because it looks for the current proxy's name which it does not have as it's the default one. This affects all versions since 1.6. This fix must be backported to all versions back to 1.6. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index b44e6fa880..9841e2dc6a 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4117,6 +4117,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) int myidx = 1; struct proxy *other; + if (curproxy == &defproxy) { + ha_alert("parsing [%s:%d] : 'stick-table' is not supported in 'defaults' section.\n", + file, linenum); + err_code |= ERR_ALERT | ERR_FATAL; + goto out; + } + other = proxy_tbl_by_name(curproxy->id); if (other) { ha_alert("parsing [%s:%d] : stick-table name '%s' conflicts with table declared in %s '%s' at %s:%d.\n",