commit 01c8ffd61f01fea781332bfc23dda4ec789296d8
parent 58c7358cb38f44ca5a4be1c4511e3f826409dfda
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 11 Feb 2025 09:29:04 +0100
tweaks: avoid running tolower() on an out-of-range value
Functions like tolower() expect characters in the range -1..255.
Reference: https://savannah.gnu.org/bugs/?50289.
The other occurrences of toupper(), tolower(), and isxdigit() that
don't do a cast are fine, because the values of 'code' or 'keycode'
are already guaranteed to be in range by the surrounding code.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/global.c b/src/global.c
@@ -507,7 +507,7 @@ functionptrtype func_from_key(const int keycode)
* with Pico or to mimic 'less' and similar text viewers. */
functionptrtype interpret(const int keycode)
{
- if (!meta_key) {
+ if (!meta_key && keycode < 0x7F) {
if (keycode == 'N')
return do_findprevious;
if (keycode == 'n')