# HG changeset patch # User Chong Yidong # Date 1265342089 18000 # Node ID ef8266a66d376a0dfc136ba0901dc1817cb11e11 # Parent 392cb4c24760a8451fa5c1b676e1c27dd3191a3f 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 -r 392cb4c24760 -r ef8266a66d37 src/ChangeLog --- a/src/ChangeLog Thu Feb 04 20:53:40 2010 -0500 +++ b/src/ChangeLog Thu Feb 04 22:54:49 2010 -0500 @@ -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 -r 392cb4c24760 -r ef8266a66d37 src/charset.c --- a/src/charset.c Thu Feb 04 20:53:40 2010 -0500 +++ b/src/charset.c Thu Feb 04 22:54:49 2010 -0500 @@ -526,7 +526,7 @@ 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 @@ close (fd); load_charset_map (charset, head, n_entries, control_flag); + xfree (head); } static void