projects
/
platform
/
upstream
/
libxkbcommon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
4fcbc47
)
Fix signed vs. unsigned confusion in name sanitisation
author
Daniel Stone
<daniels@collabora.com>
Mon, 26 Jun 2017 20:52:27 +0000
(21:52 +0100)
committer
Daniel Stone
<daniels@collabora.com>
Fri, 3 Aug 2018 15:17:10 +0000
(16:17 +0100)
Don't try to divide through a signed char when indexing an array, lest
ye try to index off the start of it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
src/keymap-priv.c
patch
|
blob
|
history
diff --git
a/src/keymap-priv.c
b/src/keymap-priv.c
index
08945ca
..
fffb2fd
100644
(file)
--- a/
src/keymap-priv.c
+++ b/
src/keymap-priv.c
@@
-118,7
+118,8
@@
XkbEscapeMapName(char *name)
return;
while (*name) {
- if (!(legal[*name / 8] & (1 << (*name % 8))))
+ unsigned char c = *name;
+ if (!(legal[c / 8] & (1 << (c % 8))))
*name = '_';
name++;
}