]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix another buffer overrun in loadfont.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Mar 2015 13:15:37 +0000 (13:15 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 4 Mar 2015 15:04:42 +0000 (16:04 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12181 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=6d98d03add92846a11b33ae5f9382a4191d7e194

ft2.c

diff --git a/ft2.c b/ft2.c
index 1711aded978e8985cc64632adc88c40210a463bc..80401bc2abdfb6b28ede16456bcdce36dd86422e 100644 (file)
--- 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);