diff options
author | Ran Benita <ran@unusedvar.com> | 2021-03-30 19:11:59 +0300 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2021-03-30 19:17:29 +0300 |
commit | 1c0e28ad2615b4dc1f816eb4e3abcc391e73784f (patch) | |
tree | 57551dd51e00e55b88aa689b4f1912baec745efc /test | |
parent | 1638409b22aef33d487863876ab214b949db4984 (diff) | |
download | xorg-lib-libxkbcommon-1c0e28ad2615b4dc1f816eb4e3abcc391e73784f.tar.gz |
keysym: properly handle overflow in 0x keysym names
Relatedly, strtoul allows a lot of unwanted stuff (spaces, +/- sign,
thousand seperators), we really ought not use it. But that's for another
time.
Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/keysym.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/keysym.c b/test/keysym.c index 3210770..b802bcb 100644 --- a/test/keysym.c +++ b/test/keysym.c @@ -145,6 +145,10 @@ main(void) assert(test_string("THORN", 0x00de)); assert(test_string("Thorn", 0x00de)); assert(test_string("thorn", 0x00fe)); + /* Max keysym. */ + assert(test_string("0xffffffff", 0xffffffff)); + /* Outside range. */ + assert(test_string("0x100000000", XKB_KEY_NoSymbol)); assert(test_keysym(0x1008FF56, "XF86Close")); assert(test_keysym(0x0, "NoSymbol")); |