[openssh-commits] [openssh] 07/09: upstream: move tree init before possible early return

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Jun 11 11:27:05 AEST 2024


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 82c836df4ff41145553cd7adb11c5b985aeaa06f
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Jun 11 01:21:41 2024 +0000

    upstream: move tree init before possible early return
    
    OpenBSD-Commit-ID: 72e2c5b69f151c08a7c5bf5ad929b97a92c273df
---
 srclimit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srclimit.c b/srclimit.c
index 5b5e688a..bac8ef66 100644
--- a/srclimit.c
+++ b/srclimit.c
@@ -108,6 +108,8 @@ srclimit_init(int max, int persource, int ipv4len, int ipv6len,
 	penalty_cfg = *penalty_conf;
 	penalty_exempt = penalty_exempt_conf == NULL ?
 	    NULL : xstrdup(penalty_exempt_conf);
+	RB_INIT(&penalties_by_addr);
+	RB_INIT(&penalties_by_expiry);
 	if (max_persource == INT_MAX)	/* no limit */
 		return;
 	debug("%s: max connections %d, per source %d, masks %d,%d", __func__,
@@ -117,8 +119,6 @@ srclimit_init(int max, int persource, int ipv4len, int ipv6len,
 	children = xcalloc(max_children, sizeof(*children));
 	for (i = 0; i < max_children; i++)
 		children[i].id = -1;
-	RB_INIT(&penalties_by_addr);
-	RB_INIT(&penalties_by_expiry);
 }
 
 /* returns 1 if connection allowed, 0 if not allowed. */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list