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.
This commit is contained in:
Alibek Omarov 2024-06-10 13:27:05 +03:00
parent bf31e9f634
commit 87840ce91d

View file

@ -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 );