aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2007-12-13 15:53:26 +0000
committerJason Rumney2007-12-13 15:53:26 +0000
commitbf2540370278fcfbe6ac2423650db8fb4e357be7 (patch)
treec017ddb2fa2b503488b0f02e16e33aea82db2ae4 /src
parent7d2a95143a15e69712313095aa24dd66a3b16f64 (diff)
downloademacs-bf2540370278fcfbe6ac2423650db8fb4e357be7.tar.gz
emacs-bf2540370278fcfbe6ac2423650db8fb4e357be7.zip
(w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
before dereferencing array. (lookup_vk_code): Remove zero comparison.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32fns.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 87f9894f488..7d2240f7829 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12007-12-13 Jason Rumney <jasonr@gnu.org>
2
3 * w32fns.c (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
4 before dereferencing array.
5 (lookup_vk_code): Remove zero comparison.
6
12007-12-02 Magnus Henoch <mange@freemail.hu> 72007-12-02 Magnus Henoch <mange@freemail.hu>
2 8
3 * process.c (make_process): Initialize pty_flag to 0. 9 * process.c (make_process): Initialize pty_flag to 0.
diff --git a/src/w32fns.c b/src/w32fns.c
index a006531f2b3..9492989e735 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2956,7 +2956,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
2956 they don't produce WM_CHAR messages). This ensures that 2956 they don't produce WM_CHAR messages). This ensures that
2957 indicator lights are toggled promptly on Windows 9x, for 2957 indicator lights are toggled promptly on Windows 9x, for
2958 example. */ 2958 example. */
2959 if (lispy_function_keys[wParam] != 0) 2959 if (wParam < 256 && lispy_function_keys[wParam])
2960 { 2960 {
2961 windows_translate = 1; 2961 windows_translate = 1;
2962 goto translate; 2962 goto translate;
@@ -3078,7 +3078,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3078 break; 3078 break;
3079 default: 3079 default:
3080 /* If not defined as a function key, change it to a WM_CHAR message. */ 3080 /* If not defined as a function key, change it to a WM_CHAR message. */
3081 if (lispy_function_keys[wParam] == 0) 3081 if (wParam > 255 || !lispy_function_keys[wParam])
3082 { 3082 {
3083 DWORD modifiers = construct_console_modifiers (); 3083 DWORD modifiers = construct_console_modifiers ();
3084 3084
@@ -8129,7 +8129,7 @@ lookup_vk_code (char *key)
8129 int i; 8129 int i;
8130 8130
8131 for (i = 0; i < 256; i++) 8131 for (i = 0; i < 256; i++)
8132 if (lispy_function_keys[i] != 0 8132 if (lispy_function_keys[i]
8133 && strcmp (lispy_function_keys[i], key) == 0) 8133 && strcmp (lispy_function_keys[i], key) == 0)
8134 return i; 8134 return i;
8135 8135
@@ -8307,7 +8307,7 @@ usage: (w32-reconstruct-hot-key ID) */)
8307 vk_code = HOTKEY_VK_CODE (hotkeyid); 8307 vk_code = HOTKEY_VK_CODE (hotkeyid);
8308 w32_modifiers = HOTKEY_MODIFIERS (hotkeyid); 8308 w32_modifiers = HOTKEY_MODIFIERS (hotkeyid);
8309 8309
8310 if (lispy_function_keys[vk_code]) 8310 if (vk_code < 256 && lispy_function_keys[vk_code])
8311 key = intern (lispy_function_keys[vk_code]); 8311 key = intern (lispy_function_keys[vk_code]);
8312 else 8312 else
8313 key = make_number (vk_code); 8313 key = make_number (vk_code);