From 3d39ab0475b4c55bcf63dabde86620044d5d5d7b Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 25 Jul 2024 08:00:00 +0800 Subject: InspIRCd v4: Fix loop condition in FJOIN memid reset There was a typo in the InspIRCd v3 code, in the FJOIN handler: The loop condition said n > 0, while n is never changed in the loop. It turns out the the loop condition should have been x > 0. This was fixed for InspIRCd v3 in commit 85716714, but it was not ported to the InspIRCd v4 protocol support code because the v4 code was copied from v3 a while ago. This commit fixes it. --- protocols/inspircd4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/inspircd4.c b/protocols/inspircd4.c index 24a2c37..ff807c7 100644 --- a/protocols/inspircd4.c +++ b/protocols/inspircd4.c @@ -1754,7 +1754,7 @@ int inspircd4_protocol_handle_fjoin(struct string source, size_t argc, struct st return 0; inspircd4_protocol_handle_fjoin_reset_member_ids: - for (size_t x = n; n > 0;) { + for (size_t x = n; x > 0;) { x--; struct inspircd4_protocol_specific_user *this = users[x]->protocol_specific[INSPIRCD4_PROTOCOL]; if (members[user_count + x]) -- cgit v1.2.3