]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: patterns: previous fix was incomplete
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Nov 2014 12:17:03 +0000 (13:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 26 Nov 2014 12:17:03 +0000 (13:17 +0100)
Dmitry Sivachenko <trtrmitya@gmail.com> reported that commit 315ec42
("BUG/MEDIUM: pattern: don't load more than once a pattern list.")
relies on an uninitialised variable in the stack. While it used to
work fine during the tests, if the uninitialized variable is non-null,
some patterns may be aggregated if loaded multiple times, resulting in
slower processing, which was the original issue it tried to address.

The fix needs to be backported to 1.5.

src/pattern.c

index 20547f9607befa789b443aa585031ace6677e178..208e33a448bdde27bdb64813b43f271b4da345bc 100644 (file)
@@ -2096,7 +2096,7 @@ int pattern_read_from_file(struct pattern_head *head, unsigned int refflags,
        struct pat_ref *ref;
        struct pattern_expr *expr;
        struct pat_ref_elt *elt;
-       int reuse;
+       int reuse = 0;
 
        /* Lookup for the existing reference. */
        ref = pat_ref_lookup(filename);