]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: avoid an infinite loop with peers_fe is NULL
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 24 Mar 2020 15:42:15 +0000 (16:42 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 24 Mar 2020 15:45:53 +0000 (16:45 +0100)
Fix an infinite loop which was added in an attempt to fix #558.
If the peers_fe is NULL, it will loop forever.

Must be backported with a2cfd7e as far as 1.8.

src/cfgparse.c

index 85fc185fb6efc9ace029ec7339b8ba9039f4bc2d..eaa853f6e161e98262c795365d64f56a3a6e95f0 100644 (file)
@@ -3911,11 +3911,10 @@ out_uri_auth_compat:
                 stick-table used in the configuration, set its bind_proc
                 by default to the first process. */
                while (curpeers) {
-                       if (!curpeers->peers_fe)
-                               continue;
-                       if (curpeers->peers_fe->bind_proc == 0)
-                               curpeers->peers_fe->bind_proc = 1;
-
+                       if (curpeers->peers_fe) {
+                               if (curpeers->peers_fe->bind_proc == 0)
+                                       curpeers->peers_fe->bind_proc = 1;
+                       }
                        curpeers = curpeers->next;
                }