diff options
author | Gaurav Ujjwal <gujjwal00@gmail.com> | 2021-05-09 05:04:36 +0000 |
---|---|---|
committer | Gaurav Ujjwal <gujjwal00@gmail.com> | 2021-05-09 11:30:09 +0530 |
commit | 838ea5a5a0267c25b20c095c9a70684edeeefba4 (patch) | |
tree | 4333f19c0be7f53c0a0c1d446cbc58274b8f3dd4 /src | |
parent | 32491b02c76ac22f99dc433a32466e22bdc181a7 (diff) |
Fix out-of-bound access in KeySymToUcs4()
Array `keysym_to_unicode_590_5fe` is only valid for range [0x590, 0x5fe] but current lower-bound is checked against 0x589.
So invalid values from 0x58a to 0x58f are being allowed by current check.
If any of these invalid value is passed as `keysym`, `keysym - 0x590` would underflow.
Signed-off-by: Gaurav Ujjwal <gujjwal00@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/xlibi18n/imKStoUCS.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xlibi18n/imKStoUCS.c b/src/xlibi18n/imKStoUCS.c index da843bbd..a1c59121 100644 --- a/src/xlibi18n/imKStoUCS.c +++ b/src/xlibi18n/imKStoUCS.c @@ -285,7 +285,7 @@ KeySymToUcs4(KeySym keysym) return keysym_to_unicode_3a2_3fe[keysym - 0x3a2]; else if (keysym > 0x4a0 && keysym < 0x4e0) return keysym_to_unicode_4a1_4df[keysym - 0x4a1]; - else if (keysym > 0x589 && keysym < 0x5ff) + else if (keysym > 0x58f && keysym < 0x5ff) return keysym_to_unicode_590_5fe[keysym - 0x590]; else if (keysym > 0x67f && keysym < 0x700) return keysym_to_unicode_680_6ff[keysym - 0x680]; |