diff mbox series

[pseudo,19/34] pseudo_server: Set highest_client to the new client when growing

Message ID 1794370862-30908-20-git-send-email-mark.hatle@kernel.crashing.org
State New
Headers show
Series Various fixes | expand

Commit Message

Mark Hatle Nov. 11, 2026, 4:20 a.m. UTC
From: Mark Hatle <mark.hatle@amd.com>

When open_client() grows the client table, the new client goes in slot
max_clients, but highest_client was set to max_clients + 1, one past
it.  This was harmless, as that slot exists and is unused, but the
server scanned it needlessly.

AI-Generated: Uses GitHub Copilot
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
 pseudo_server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/pseudo_server.c b/pseudo_server.c
index edcb23e..13caced 100644
--- a/pseudo_server.c
+++ b/pseudo_server.c
@@ -407,7 +407,7 @@  open_client(int fd) {
 		clients[max_clients].pid = 0;
 		clients[max_clients].tag = NULL;
 		clients[max_clients].program = NULL;
-		highest_client = max_clients + 1;
+		highest_client = max_clients;
 
 		max_clients += 16;
 		++active_clients;