Package: haproxy / 1.5.8-3+deb8u2

from-upstream/0008-BUG-MEDIUM-patterns-previous-fix-was-incomplete.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From c14cbb9b8c360b63db24ec50a96625300186fca2 Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Wed, 26 Nov 2014 13:17:03 +0100
Subject: [PATCH 8/9] BUG/MEDIUM: patterns: previous fix was incomplete

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.
(cherry picked from commit 4deaf39243c4d941998b1b0175bad05b8a287c0b)
---
 src/pattern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pattern.c b/src/pattern.c
index 20547f9607be..208e33a448bd 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -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);
-- 
2.1.3