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.

39 lines
1.4 KiB

  1. From 4ab232ce2fbdaf9b871c411fc7284096219bb854 Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Fri, 10 Oct 2014 14:54:25 +0200
  4. Subject: [PATCH 2/2] BUG/MEDIUM: config: avoid skipping disabled proxies
  5. Paul Taylor and Bryan Talbot found that after commit 419ead8 ("MEDIUM:
  6. config: compute the exact bind-process before listener's maxaccept"),
  7. a backend marked "disabled" would cause the next backend to be skipped
  8. and if it was the last one it would cause a segfault.
  9. The reason is that the commit above changed the "while" loop for a "for"
  10. loop but a "continue" statement still incrementing the current proxy was
  11. left in the code for disabled proxies, causing the next one to be skipped
  12. as well and the last one to try to dereference NULL when seeking ->next.
  13. The quick workaround consists in not disabling backends, or adding an
  14. empty dummy one after a disabled section.
  15. This fix must be backported to 1.5.
  16. (cherry picked from commit 06cc905813f1858c0606b44d1e271bd0b6a25224)
  17. ---
  18. src/cfgparse.c | 1 -
  19. 1 file changed, 1 deletion(-)
  20. diff --git a/src/cfgparse.c b/src/cfgparse.c
  21. index ec6d923..392a692 100644
  22. --- a/src/cfgparse.c
  23. +++ b/src/cfgparse.c
  24. @@ -6104,7 +6104,6 @@ int check_config_validity()
  25. if (curproxy->state == PR_STSTOPPED) {
  26. /* ensure we don't keep listeners uselessly bound */
  27. stop_proxy(curproxy);
  28. - curproxy = curproxy->next;
  29. continue;
  30. }
  31. --
  32. 1.8.5.5