]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: make the stats socket pass the correct proxy to the parsers
authorWilly Tarreau <w@1wt.eu>
Tue, 13 Oct 2015 13:06:57 +0000 (15:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 Oct 2015 13:49:31 +0000 (15:49 +0200)
Baptiste reported a segfault when the "id" keyword was passed on the
"stats socket" line. The problem is related to the fact that the stats
parser stats_parse_global() passes curpx instead of global.stats_fe to
the keyword parser. Indeed, curpx being a pointer to the proxy in the
current section, it is not correct here since the global section does
not describe a proxy. It's just by pure luck that only bind_parse_id()
uses the proxy since any other keyword parser could use it as well.

The bug has no impact since the id specified here is not usable at all
and can be discarded from a faulty configuration.

This fix must be backported to 1.5.

src/dumpstats.c

index 169b9acf2178be815a57dd072abd6cbc2a67c3c6..e80e45c91dfd56c37c641d1baade15fb04fec050 100644 (file)
@@ -330,7 +330,7 @@ static int stats_parse_global(char **args, int section_type, struct proxy *curpx
                                        return -1;
                                }
 
-                               if (kw->parse(args, cur_arg, curpx, bind_conf, err) != 0) {
+                               if (kw->parse(args, cur_arg, global.stats_fe, bind_conf, err) != 0) {
                                        if (err && *err)
                                                memprintf(err, "'%s %s' : '%s'", args[0], args[1], *err);
                                        else