+2007-12-13 Jason Rumney <jasonr@gnu.org>
+
+ * w32fns.c (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
+ before dereferencing array.
+ (lookup_vk_code): Remove zero comparison.
+
2007-12-02 Magnus Henoch <mange@freemail.hu>
* process.c (make_process): Initialize pty_flag to 0.
they don't produce WM_CHAR messages). This ensures that
indicator lights are toggled promptly on Windows 9x, for
example. */
- if (lispy_function_keys[wParam] != 0)
+ if (wParam < 256 && lispy_function_keys[wParam])
{
windows_translate = 1;
goto translate;
break;
default:
/* If not defined as a function key, change it to a WM_CHAR message. */
- if (lispy_function_keys[wParam] == 0)
+ if (wParam > 255 || !lispy_function_keys[wParam])
{
DWORD modifiers = construct_console_modifiers ();
int i;
for (i = 0; i < 256; i++)
- if (lispy_function_keys[i] != 0
+ if (lispy_function_keys[i]
&& strcmp (lispy_function_keys[i], key) == 0)
return i;
vk_code = HOTKEY_VK_CODE (hotkeyid);
w32_modifiers = HOTKEY_MODIFIERS (hotkeyid);
- if (lispy_function_keys[vk_code])
+ if (vk_code < 256 && lispy_function_keys[vk_code])
key = intern (lispy_function_keys[vk_code]);
else
key = make_number (vk_code);