From ab042d2a99180b4bccb49792bf004a8de9d37eb3 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 4 Mar 2015 13:15:37 +0000 Subject: [PATCH] Fix another buffer overrun in loadfont. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12181 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=6d98d03add92846a11b33ae5f9382a4191d7e194 --- ft2.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.2