From: Christopher Faulet Date: Thu, 23 Feb 2017 21:41:09 +0000 (+0100) Subject: BUG/MINOR: spoe: Fix parsing of arguments in spoe-message section X-Git-Tag: v1.8-dev1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0b42388259224be54bf504fa559803b39d6453c;p=thirdparty%2Fhaproxy.git BUG/MINOR: spoe: Fix parsing of arguments in spoe-message section The array of pointers passed to sample_parse_expr was not really an array but a pointer to pointer. So it can easily lead to a segfault during the configuration parsing. --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 88f782ffcd..f5918dc5f0 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2947,8 +2947,9 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm) arg->name_len = delim - args[cur_arg]; delim++; } - - arg->expr = sample_parse_expr(&delim, &idx, file, linenum, &errmsg, &curproxy->conf.args); + arg->expr = sample_parse_expr((char*[]){delim, NULL}, + &idx, file, linenum, &errmsg, + &curproxy->conf.args); if (arg->expr == NULL) { Alert("parsing [%s:%d] : '%s': %s.\n", file, linenum, args[0], errmsg); err_code |= ERR_ALERT | ERR_FATAL;