From 3088147c5df9ff1ca0bcd6b5bdb1f7170fab909c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 4 Feb 2010 22:54:49 -0500 Subject: [PATCH] Fix for Bug#5526. * charset.c (load_charset_map_from_file): Allocate large charset_map_entries structure on the heap rather than the stack. (Bug#5526). --- src/ChangeLog | 6 ++++++ src/charset.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7277400a0f1..f1f4aa24b35 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-02-05 Chong Yidong + + * charset.c (load_charset_map_from_file): Allocate large + charset_map_entries structure on the heap rather than the stack. + (Bug#5526). + 2010-01-31 Kenichi Handa * font.c (font_parse_xlfd): If FONT is a font-entity and pixel diff --git a/src/charset.c b/src/charset.c index 0f6bb4f0906..9e8ff1d59c9 100644 --- a/src/charset.c +++ b/src/charset.c @@ -526,7 +526,7 @@ load_charset_map_from_file (charset, mapfile, control_flag) error ("Failure in loading charset map: %S", SDATA (mapfile)); head = entries = ((struct charset_map_entries *) - alloca (sizeof (struct charset_map_entries))); + xmalloc (sizeof (struct charset_map_entries))); n_entries = 0; eof = 0; while (1) @@ -563,6 +563,7 @@ load_charset_map_from_file (charset, mapfile, control_flag) close (fd); load_charset_map (charset, head, n_entries, control_flag); + xfree (head); } static void -- 2.39.5