From 6d7d08726f4b0c517041842b27cd7e66e8f371eb Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Apr 2022 14:51:55 -0700 Subject: [PATCH] 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 --- src/xkb/XKBMisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- GitLab