From 4c3052ebcdf66bf84659707ec6fd6d66552115d6 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 5 Mar 2015 10:48:27 +0000 Subject: [PATCH] Fix buffer overrun in font loading. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12192 d7cf8633-e32d-0410-b094-e92efae38249 --- ft2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ft2.c b/ft2.c index 80401bc2..bc9544f2 100644 --- a/ft2.c +++ b/ft2.c @@ -703,7 +703,7 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti Con_Printf("Failed to add attachment %u to %s\n", (unsigned)i, font->name); } - memcpy(font->name, name, namelen+1); + strlcpy(font->name, name, sizeof(font->name)); font->image_font = false; font->has_kerning = !!(((FT_Face)(font->face))->face_flags & FT_FACE_FLAG_KERNING); return true; -- 2.39.2