aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-02-04 22:54:49 -0500
committerChong Yidong2010-02-04 22:54:49 -0500
commit3088147c5df9ff1ca0bcd6b5bdb1f7170fab909c (patch)
tree6846a54bba2aff247000667d3ceb9aa9ead0e367
parentbdd428996e3c2cc58ffcde8b0cb2215e2e2b247c (diff)
downloademacs-3088147c5df9ff1ca0bcd6b5bdb1f7170fab909c.tar.gz
emacs-3088147c5df9ff1ca0bcd6b5bdb1f7170fab909c.zip
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).
-rw-r--r--src/ChangeLog6
-rw-r--r--src/charset.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7277400a0f1..f1f4aa24b35 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12010-02-05 Chong Yidong <cyd@stupidchicken.com>
2
3 * charset.c (load_charset_map_from_file): Allocate large
4 charset_map_entries structure on the heap rather than the stack.
5 (Bug#5526).
6
12010-01-31 Kenichi Handa <handa@m17n.org> 72010-01-31 Kenichi Handa <handa@m17n.org>
2 8
3 * font.c (font_parse_xlfd): If FONT is a font-entity and pixel 9 * 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)
526 error ("Failure in loading charset map: %S", SDATA (mapfile)); 526 error ("Failure in loading charset map: %S", SDATA (mapfile));
527 527
528 head = entries = ((struct charset_map_entries *) 528 head = entries = ((struct charset_map_entries *)
529 alloca (sizeof (struct charset_map_entries))); 529 xmalloc (sizeof (struct charset_map_entries)));
530 n_entries = 0; 530 n_entries = 0;
531 eof = 0; 531 eof = 0;
532 while (1) 532 while (1)
@@ -563,6 +563,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
563 close (fd); 563 close (fd);
564 564
565 load_charset_map (charset, head, n_entries, control_flag); 565 load_charset_map (charset, head, n_entries, control_flag);
566 xfree (head);
566} 567}
567 568
568static void 569static void