From 1a8855bcea7f353865a05590269a9ea8e284b2dd Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 11 Jun 2024 01:23:25 +0000 Subject: [PATCH] a little more RB_TREE paranoia --- usr.bin/ssh/srclimit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/srclimit.c b/usr.bin/ssh/srclimit.c index c89deefa8cf..c4bc5fee273 100644 --- a/usr.bin/ssh/srclimit.c +++ b/usr.bin/ssh/srclimit.c @@ -293,14 +293,14 @@ srclimit_remove_expired_penalties(void) while (npenalties > (size_t)penalty_cfg.max_sources) { if ((p = RB_MIN(penalties_by_expiry, &penalties_by_expiry)) == NULL) - break; /* shouldn't happen */ + fatal_f("internal error: penalty tables corrupt (find)"); bits = p->addr.af == AF_INET ? ipv4_masklen : ipv6_masklen; addr_masklen_ntop(&p->addr, bits, s, sizeof(s)); debug3_f("overflow, remove %s", s); if (RB_REMOVE(penalties_by_expiry, &penalties_by_expiry, p) != p || RB_REMOVE(penalties_by_addr, &penalties_by_addr, p) != p) - fatal_f("internal error: penalty tables corrupt"); + fatal_f("internal error: penalty tables corrupt (remove)"); free(p); npenalties--; } -- 2.20.1