Fix xkb_keysym_from_name for numeric keysyms
When parsing hexadecimal keysym using `xkb_keysym_from_name`, the result is limited by `parse_keysym_hex` to 0xffffffff, but the maximum keysym is XKB_MAX_KEYSYM, i.e. 0x1fffffff. Fixed by adding an upper bound.master
parent
4823838fa3
commit
397e7e013d
|
@ -208,6 +208,8 @@ xkb_keysym_from_name(const char *name, enum xkb_keysym_flags flags)
|
||||||
else if (name[0] == '0' && (name[1] == 'x' || (icase && name[1] == 'X'))) {
|
else if (name[0] == '0' && (name[1] == 'x' || (icase && name[1] == 'X'))) {
|
||||||
if (!parse_keysym_hex(&name[2], &val))
|
if (!parse_keysym_hex(&name[2], &val))
|
||||||
return XKB_KEY_NoSymbol;
|
return XKB_KEY_NoSymbol;
|
||||||
|
if (val > XKB_KEYSYM_MAX)
|
||||||
|
return XKB_KEY_NoSymbol;
|
||||||
return (xkb_keysym_t) val;
|
return (xkb_keysym_t) val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue