[PATCH 26/32] [libx11] Using uninitialized value "conv->state" in call to function "close_converter"

Erkki Seppälä erkki.seppala at vincit.fi
Wed Jan 26 23:54:09 PST 2011


From: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>

Fixed by zero'ing conv on allocation. Then close_converter works properly.

Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
---
 modules/lc/def/lcDefConv.c |    2 +-
 modules/lc/gen/lcGenConv.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/lc/def/lcDefConv.c b/modules/lc/def/lcDefConv.c
index 5860a79..12a4861 100644
--- a/modules/lc/def/lcDefConv.c
+++ b/modules/lc/def/lcDefConv.c
@@ -577,7 +577,7 @@ create_conv(
     XlcConv conv;
     State state;
 
-    conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
+    conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec));
     if (conv == NULL)
 	return (XlcConv) NULL;
 
diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
index 074a8d7..baac73a 100644
--- a/modules/lc/gen/lcGenConv.c
+++ b/modules/lc/gen/lcGenConv.c
@@ -2650,7 +2650,7 @@ create_conv(
     XlcConv conv;
     State state;
 
-    conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
+    conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec));
     if (conv == NULL)
 	return (XlcConv) NULL;
 
-- 
1.7.0.4



More information about the xorg-devel mailing list