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
(parent:
9813778
)
Add a NULL check before before strcmp'ing
author
Ran Benita
<ran234@gmail.com>
Sun, 1 Apr 2012 13:51:48 +0000
(16:51 +0300)
committer
Daniel Stone
<daniel@fooishbar.org>
Mon, 2 Apr 2012 12:09:40 +0000
(13:09 +0100)
The names array can have NULL entries for some virtual modifier indexes.
Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/vmod.c
patch
|
blob
|
history
diff --git
a/src/xkbcomp/vmod.c
b/src/xkbcomp/vmod.c
index
799185d
..
1a9d43d
100644
(file)
--- a/
src/xkbcomp/vmod.c
+++ b/
src/xkbcomp/vmod.c
@@
-242,7
+242,8
@@
ResolveVirtualModifier(ExprDef * def, struct xkb_desc *xkb,
const char *name = XkbcAtomText(def->value.str);
for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1)
{
- if ((info->available & bit) && strcmp(names->vmods[i], name) == 0)
+ if ((info->available & bit) && names->vmods[i] &&
+ strcmp(names->vmods[i], name) == 0)
{
val_rtrn->uval = i;
return True;