From 5d808fe4d7cee2329116ba3e28b02ed05d5ca749 Mon Sep 17 00:00:00 2001 From: slipher Date: Tue, 17 Nov 2026 11:00:06 -0600 Subject: [PATCH] Fix max message size calc for fragmented packets Thanks to Dickson Wu (SEAL & CertiK) for reporting the issue and explaining how it could be fixed. --- src/engine/qcommon/net_chan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/qcommon/net_chan.cpp b/src/engine/qcommon/net_chan.cpp index 30d2fa8d8c..79b0c9d7c3 100644 --- a/src/engine/qcommon/net_chan.cpp +++ b/src/engine/qcommon/net_chan.cpp @@ -392,9 +392,9 @@ bool Netchan_Process( netchan_t *chan, msg_t *msg ) return false; } - if ( chan->fragmentLength > msg->maxsize ) + if ( chan->fragmentLength + 4 > msg->maxsize ) { - Log::Notice( "%s: fragmentLength %i > msg->maxsize" + Log::Notice( "%s: total fragments length %i exceeds max msg size" , NET_AdrToString( chan->remoteAddress ), chan->fragmentLength ); return false;