]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: prevent the dump of uninitialized vars
authorThierry Fournier <tfournier@arpalert.org>
Fri, 25 Mar 2016 07:43:46 +0000 (08:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Mar 2016 13:38:10 +0000 (15:38 +0200)
Some vars are not initialized when the dumps of variables
are called. This patch prevent the dereferencement of
uninitialized pointers.

src/dumpstats.c

index 1bb5d8858e61fa2e67f3cd145e35b0d90a5fff03..9dd859f87eec45fe1e8ea6c876523956c14ab52e 100644 (file)
@@ -4107,6 +4107,9 @@ static int stats_dump_li_stats(struct stream_interface *si, struct proxy *px, st
        struct appctx *appctx = __objt_appctx(si->end);
        struct chunk *out = get_trash_chunk();
 
+       if (!l->counters)
+               return 0;
+
        chunk_reset(out);
        memset(&stats, 0, sizeof(stats));