You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

  1. From bad3c6f1b6d776e5d9951a3b3054b4dce8922c54 Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Wed, 26 Nov 2014 13:17:03 +0100
  4. Subject: [PATCH 1/2] BUG/MEDIUM: patterns: previous fix was incomplete
  5. Dmitry Sivachenko <trtrmitya@gmail.com> reported that commit 315ec42
  6. ("BUG/MEDIUM: pattern: don't load more than once a pattern list.")
  7. relies on an uninitialised variable in the stack. While it used to
  8. work fine during the tests, if the uninitialized variable is non-null,
  9. some patterns may be aggregated if loaded multiple times, resulting in
  10. slower processing, which was the original issue it tried to address.
  11. The fix needs to be backported to 1.5.
  12. (cherry picked from commit 4deaf39243c4d941998b1b0175bad05b8a287c0b)
  13. ---
  14. src/pattern.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/src/pattern.c b/src/pattern.c
  17. index 20547f9..208e33a 100644
  18. --- a/src/pattern.c
  19. +++ b/src/pattern.c
  20. @@ -2096,7 +2096,7 @@ int pattern_read_from_file(struct pattern_head *head, unsigned int refflags,
  21. struct pat_ref *ref;
  22. struct pattern_expr *expr;
  23. struct pat_ref_elt *elt;
  24. - int reuse;
  25. + int reuse = 0;
  26. /* Lookup for the existing reference. */
  27. ref = pat_ref_lookup(filename);
  28. --
  29. 2.0.4