summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-09-07 06:27:33 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-09-07 06:27:33 -0700
commit2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef (patch)
tree9ce8332e5ecf65dc0cfc37f3f63c549c7051e95b /src/keyboard.c
parentd3cb31cbdfa38a19e9517bf817f106ee82d62986 (diff)
downloademacs-2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef.tar.gz
emacs-2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef.tar.bz2
emacs-2b95a8efed84d6ec8f178a3bfbbcbfdee3ab35ef.zip
* keyboard.c (read_decoded_event_from_main_queue): Reinstitute alloca
here for destination buffer, to work around what appears to be a bug in decode_coding_c_string when the source and destination are both C strings. * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items)
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 9e14560404b..eef0770684e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2362,7 +2362,14 @@ read_decoded_event_from_main_queue (struct timespec *end_time,
if (meta_key != 2)
for (i = 0; i < n; i++)
src[i] &= ~0x80;
- coding->destination = dest;
+
+ /* FIXME: For some reason decode_coding_c_string requires a
+ fresh output buffer each time, and reusing the old buffer can
+ make Emacs dump core. Avoid triggering the problem for now
+ by allocating a new buffer each time through the loop. */
+ bool please_fixme = true;
+ coding->destination = please_fixme ? alloca (n * 4) : dest;
+
coding->dst_bytes = n * 4;
decode_coding_c_string (coding, src, n, Qnil);
eassert (coding->produced_char <= n);