From 7c328bda9b78d83e820e93ebc4093b9fb4e1348a Mon Sep 17 00:00:00 2001 From: RaphaelIT7 <64648134+RaphaelIT7@users.noreply.github.com> Date: Tue, 3 Feb 2026 19:59:21 +0100 Subject: [PATCH] engine: do not stackalloc CSplitPacketEntry --- engine/net_ws.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/engine/net_ws.cpp b/engine/net_ws.cpp index e1eecd363..690564370 100644 --- a/engine/net_ws.cpp +++ b/engine/net_ws.cpp @@ -1122,12 +1122,11 @@ CSplitPacketEntry *NET_FindOrCreateSplitPacketEntry( const intp sock, netadr_t * if ( i >= count ) { - CSplitPacketEntry newentry; - newentry.from = *from; + // RaphaelIT7: Use AddToTailGetPtr to avoid stack allocating CSplitPacketEntry as it was allocated either way & this way won't hit a stack overflow. + CSplitPacketEntry* newentry = splitPacketEntries.AddToTailGetPtr(); + newentry->from = *from; - splitPacketEntries.AddToTail( newentry ); - - entry = &splitPacketEntries[ splitPacketEntries.Count() - 1 ]; + entry = newentry; } Assert( entry );