From 6f774bae7c7228e8940bdce58b8caee450dbd24b Mon Sep 17 00:00:00 2001 From: res Date: Mon, 17 Dec 2007 02:41:34 +0000 Subject: [PATCH] Fixed user font initialization writing beyond fonts array bounds. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7806 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gl_draw.c b/gl_draw.c index cace08b9..de47e546 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -726,7 +726,7 @@ void GL_Draw_Init (void) strlcpy(FONT_CENTERPRINT->title, "centerprint", sizeof(FONT_CENTERPRINT->title)); strlcpy(FONT_INFOBAR->title, "infobar", sizeof(FONT_INFOBAR->title)); strlcpy(FONT_MENU->title, "menu", sizeof(FONT_MENU->title)); - for(i = 0, j = 0; i < MAX_FONTS; ++i) + for(i = 0, j = 0; i < MAX_USERFONTS; ++i) if(!FONT_USER[i].title[0]) dpsnprintf(FONT_USER[i].title, sizeof(FONT_USER[i].title), "user%d", j++); } -- 2.39.2