[PATCH v2 21/25] [libx11] Fixed by zero'ing conv on allocation. Then close_converter works properly.
Erkki Seppälä
erkki.seppala at vincit.fi
Mon Jan 31 04:02:13 PST 2011
From: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
Using uninitialized value "conv->state" in call to function "close_converter"
Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
---
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