From: Chong Yidong Date: Fri, 5 Feb 2010 03:54:49 +0000 (-0500) Subject: Fix for Bug#5526. X-Git-Tag: emacs-pretest-23.1.93~108 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3088147c5df9ff1ca0bcd6b5bdb1f7170fab909c;p=emacs.git 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). --- 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