From: divverent Date: Thu, 5 Mar 2015 10:48:27 +0000 (+0000) Subject: Fix buffer overrun in font loading. X-Git-Tag: xonotic-v0.8.1~8^2~11 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=4c3052ebcdf66bf84659707ec6fd6d66552115d6;p=xonotic%2Fdarkplaces.git Fix buffer overrun in font loading. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12192 d7cf8633-e32d-0410-b094-e92efae38249 --- 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;