diff options
| author | Stefan Monnier | 2003-06-15 21:04:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-06-15 21:04:16 +0000 |
| commit | 50acda85ee021f6128831acea74c9a40287d1410 (patch) | |
| tree | ad8093fb44faa50c9db0d11ac4ae0146fc9ac250 /src | |
| parent | c658018ff8e3a85e5dbfd0d5eff5b7f1a207ff69 (diff) | |
| download | emacs-50acda85ee021f6128831acea74c9a40287d1410.tar.gz emacs-50acda85ee021f6128831acea74c9a40287d1410.zip | |
(kbd_input_ast, read_input_waiting): Don't pass uninitialized
data to kbd_buffer_store_event.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 8d9d1beb519..193f0630cbf 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Interfaces to system-dependent kernel and library entries. | 1 | /* Interfaces to system-dependent kernel and library entries. |
| 2 | Copyright (C) 1985, 86,87,88,93,94,95, 1999, 2000, 2001 | 2 | Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -2008,6 +2008,8 @@ kbd_input_ast () | |||
| 2008 | if (c >= 0) | 2008 | if (c >= 0) |
| 2009 | { | 2009 | { |
| 2010 | struct input_event e; | 2010 | struct input_event e; |
| 2011 | EVENT_INIT (e); | ||
| 2012 | |||
| 2011 | e.kind = ASCII_KEYSTROKE_EVENT; | 2013 | e.kind = ASCII_KEYSTROKE_EVENT; |
| 2012 | XSETINT (e.code, c); | 2014 | XSETINT (e.code, c); |
| 2013 | e.frame_or_window = selected_frame; | 2015 | e.frame_or_window = selected_frame; |
| @@ -2622,14 +2624,15 @@ sys_select (nfds, rfds, wfds, efds, timeout) | |||
| 2622 | void | 2624 | void |
| 2623 | read_input_waiting () | 2625 | read_input_waiting () |
| 2624 | { | 2626 | { |
| 2625 | struct input_event e; | ||
| 2626 | int nread, i; | 2627 | int nread, i; |
| 2627 | extern int quit_char; | 2628 | extern int quit_char; |
| 2628 | 2629 | ||
| 2629 | if (read_socket_hook) | 2630 | if (read_socket_hook) |
| 2630 | { | 2631 | { |
| 2631 | struct input_event buf[256]; | 2632 | struct input_event buf[256]; |
| 2632 | 2633 | for (i = 0; i < 256; i++) | |
| 2634 | EVENT_INIT (buf[i]); | ||
| 2635 | |||
| 2633 | read_alarm_should_throw = 0; | 2636 | read_alarm_should_throw = 0; |
| 2634 | if (! setjmp (read_alarm_throw)) | 2637 | if (! setjmp (read_alarm_throw)) |
| 2635 | nread = (*read_socket_hook) (0, buf, 256, 1); | 2638 | nread = (*read_socket_hook) (0, buf, 256, 1); |
| @@ -2649,8 +2652,10 @@ read_input_waiting () | |||
| 2649 | } | 2652 | } |
| 2650 | else | 2653 | else |
| 2651 | { | 2654 | { |
| 2655 | struct input_event e; | ||
| 2652 | char buf[3]; | 2656 | char buf[3]; |
| 2653 | nread = read (fileno (stdin), buf, 1); | 2657 | nread = read (fileno (stdin), buf, 1); |
| 2658 | EVENT_INIT (e); | ||
| 2654 | 2659 | ||
| 2655 | /* Scan the chars for C-g and store them in kbd_buffer. */ | 2660 | /* Scan the chars for C-g and store them in kbd_buffer. */ |
| 2656 | e.kind = ASCII_KEYSTROKE_EVENT; | 2661 | e.kind = ASCII_KEYSTROKE_EVENT; |