[PATCH v2 2/3] [libx11] Using uninitialized value "p->modifiers"

Erkki Seppälä erkki.seppala at vincit.fi
Mon Jan 31 02:03:33 PST 2011


Small fix by using Xcalloc instead of Xmalloc

Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>

diff --git a/src/KeyBind.c b/src/KeyBind.c
index 6d80a02..ac25ce2 100644
--- a/src/KeyBind.c
+++ b/src/KeyBind.c
@@ -996,7 +996,7 @@ XRebindKeysym (
     tmp = dpy->key_bindings;
     nb = sizeof(KeySym) * nm;
 
-    if ((! (p = (struct _XKeytrans *) Xmalloc( sizeof(struct _XKeytrans)))) ||
+    if ((! (p = (struct _XKeytrans *) Xcalloc( 1, sizeof(struct _XKeytrans)))) ||
 	((! (p->string = (char *) Xmalloc( (unsigned) nbytes))) &&
 	 (nbytes > 0)) ||
 	((! (p->modifiers = (KeySym *) Xmalloc( (unsigned) nb))) &&
-- 
1.7.0.4



More information about the xorg-devel mailing list