From: divverent Date: Wed, 4 Mar 2015 13:15:37 +0000 (+0000) Subject: Fix another buffer overrun in loadfont. X-Git-Tag: xonotic-v0.8.1~8^2~22 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6d98d03add92846a11b33ae5f9382a4191d7e194;p=xonotic%2Fdarkplaces.git Fix another buffer overrun in loadfont. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12181 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/ft2.c b/ft2.c index 1711aded..80401bc2 100644 --- a/ft2.c +++ b/ft2.c @@ -629,6 +629,11 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti font->settings = settings; namelen = strlen(name); + if (namelen + 5 > sizeof(filename)) + { + Con_Printf("WARNING: too long font name. Cannot load this.\n"); + return false; + } // try load direct file memcpy(filename, name, namelen+1);