summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-10 14:51:55 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-10 14:51:55 -0700
commit6d7d08726f4b0c517041842b27cd7e66e8f371eb (patch)
treeff0a594dd78c41cb95ddf7a1e07e1e039b3f9061
parent9ac6859c20be2fc5e70c2908de60c6e466ec04e1 (diff)
downloadxorg-lib-libX11-6d7d08726f4b0c517041842b27cd7e66e8f371eb.tar.gz
XkbUpdateKeyTypeVirtualMods: always initialize mask
XkbVirtualModsToReal should only fail to set mask if the server does not support XKB, but it still made Oracle Parfait complain: Error: Uninitialised memory Uninitialised memory variable [uninitialised-mem-var] (CWE 457): Possible access to uninitialised memory referenced by variable 'mask' at line 863 of lib/libX11/src/xkb/XKBMisc.c in function 'XkbUpdateKeyTypeVirtualMods'. Path in callee avoiding write at line 862 mask allocated at line 860 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/xkb/XKBMisc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xkb/XKBMisc.c b/src/xkb/XKBMisc.c
index 880a616e..1ffb4404 100644
--- a/src/xkb/XKBMisc.c
+++ b/src/xkb/XKBMisc.c
@@ -857,7 +857,7 @@ XkbUpdateKeyTypeVirtualMods(XkbDescPtr xkb,
XkbChangesPtr changes)
{
register unsigned int i;
- unsigned int mask;
+ unsigned int mask = 0;
XkbVirtualModsToReal(xkb, type->mods.vmods, &mask);
type->mods.mask = type->mods.real_mods | mask;