From e1ba0a8a6f5437302bd15a8fc324c0d33fa0d546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Tue, 28 Oct 2025 23:01:02 +0100 Subject: [PATCH] Fix buffer underflow when querying invalid nodes --- src/i_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index 2690bbc7e..89096b482 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -752,7 +752,7 @@ static void SOCK_Send(void) int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once size_t i, j; - if (!nodeconnected[doomcom->remotenode]) + if (doomcom->remotenode < 0 || !nodeconnected[doomcom->remotenode]) return; if (doomcom->remotenode == BROADCASTADDR)