From 87840ce91db543b4af340bf7cc6ffe478a47c040 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 10 Jun 2024 13:27:05 +0300 Subject: [PATCH] engine: fix potential buffer overflow in Mod_StudioTexName * Model names are 64 bytes wide, adding texture character means we needs 65 byte wide string. * It never gets stored in memory anyway. --- engine/common/mod_studio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/common/mod_studio.c b/engine/common/mod_studio.c index 4b2cd48e..39d43c6a 100644 --- a/engine/common/mod_studio.c +++ b/engine/common/mod_studio.c @@ -780,7 +780,7 @@ extract texture filename from modelname */ const char *Mod_StudioTexName( const char *modname ) { - static char texname[MAX_QPATH]; + static char texname[MAX_QPATH+1]; Q_strncpy( texname, modname, sizeof( texname )); COM_StripExtension( texname );