From 3ef2d565303af6dd7c24b62fdb22e43f1d1638bf Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 24 Mar 2020 16:42:15 +0100 Subject: [PATCH] BUG/MINOR: peers: avoid an infinite loop with peers_fe is NULL 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index 85fc185fb..eaa853f6e 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3911,11 +3911,10 @@ int check_config_validity() 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; }