From c29aba0526ec3e818eaa5d3125924e9d3b7e64d3 Mon Sep 17 00:00:00 2001 From: Tim Retout Date: Thu, 9 Apr 2009 22:30:41 +0100 Subject: [PATCH] Avoid overflowing user_font_name by using dynamic allocation. --- src/psgen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/psgen.c b/src/psgen.c index b827fe1..4bae4bd 100644 --- a/src/psgen.c +++ b/src/psgen.c @@ -247,7 +247,7 @@ static int do_print = 1; static int user_fontp = 0; /* The user ^@font{}-defined font. */ -static char user_font_name[256]; +static char *user_font_name; static FontPoint user_font_pt; static InputEncoding user_font_encoding; @@ -977,6 +977,7 @@ large for page\n"), FATAL ((stderr, _("user font encoding can be only the system's default or `ps'"))); + xrealloc(user_font_name, strlen(token.u.font.name) + 1); strcpy (user_font_name, token.u.font.name); user_font_pt.w = token.u.font.size.w; user_font_pt.h = token.u.font.size.h; -- 2.17.1