From 9ca1776f1a46326ed2e8ecc6bf9b80473c1bbda8 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 8 Aug 2026 19:00:03 +0200 Subject: [PATCH] ensure serverinfo "application" is null terminated not strictly needed but better be safe than sorry --- src/d_clisrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6213422f6..fb955a346 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1660,8 +1660,8 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.packetversion = PACKETVERSION; netbuffer->u.serverinfo.version = VERSION; netbuffer->u.serverinfo.subversion = SUBVERSION; - strncpy(netbuffer->u.serverinfo.application, SRB2APPLICATION, - sizeof netbuffer->u.serverinfo.application); + strncpy(netbuffer->u.serverinfo.application, SRB2APPLICATION, sizeof(netbuffer->u.serverinfo.application)-1); + netbuffer->u.serverinfo.application[sizeof(netbuffer->u.serverinfo.application)-1] = '\0'; // return back the time value so client can compute their ping netbuffer->u.serverinfo.time = (tic_t)LONG(servertime); netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime);