]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: spoe: Fix parsing of arguments in spoe-message section
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Feb 2017 21:41:09 +0000 (22:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 9 Mar 2017 14:32:55 +0000 (15:32 +0100)
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.

src/flt_spoe.c

index 88f782ffcd82349ba8ec08bdd549a8a2282a0cb7..f5918dc5f029eca0c574754dac240976c00adfcd 100644 (file)
@@ -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;