From c68e1c53f37670479a2fb35756c4b2ba83f54025 Mon Sep 17 00:00:00 2001 From: Wolfy Date: Sun, 12 Apr 2020 21:14:33 -0500 Subject: [PATCH] Fix off by one error in http downloader --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 605aa73f..a211fc48 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1475,7 +1475,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) if (mirror_length > MAX_MIRROR_LENGTH) mirror_length = MAX_MIRROR_LENGTH; - if (snprintf(netbuffer->u.serverinfo.httpsource, mirror_length, "%s", httpurl) < 0) + if (snprintf(netbuffer->u.serverinfo.httpsource, mirror_length+1, "%s", httpurl) < 0) // If there's an encoding error, send nothing, we accept that the above may be truncated strncpy(netbuffer->u.serverinfo.httpsource, "", mirror_length);