]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: cache: fix random crash on filter parser's error path
authorWilly Tarreau <w@1wt.eu>
Fri, 14 Dec 2018 09:19:28 +0000 (10:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Dec 2018 09:19:28 +0000 (10:19 +0100)
The cconf variable was not initialized before the two first possible
error exits before being freed, resulting in random crashes instead
of displaying an error message if the cache ID was missing from the
filter declaration.

No backport is needed, this is exclusively 1.9.

src/cache.c

index 9cfb5350ba761d87936bf589fe90d3e5d752b34c..74743f2b51c9c3ccb68fda3223cdba3a8906a391 100644 (file)
@@ -1639,7 +1639,7 @@ parse_cache_flt(char **args, int *cur_arg, struct proxy *px,
                struct flt_conf *fconf, char **err, void *private)
 {
        struct flt_conf *f, *back;
-       struct cache_flt_conf *cconf;
+       struct cache_flt_conf *cconf = NULL;
        char *name = NULL;
        int pos = *cur_arg;