diff options
author | Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> | 2011-01-31 14:02:13 +0200 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-02-01 23:47:11 -0800 |
commit | e2566e43b02d2d7b7c1c3bb7db7c5ae81c1245fa (patch) | |
tree | b202e729f1ee793733451b7ae64c4c07af142244 | |
parent | 03f81ad8fb9783986cf9b17661dd31e95c396681 (diff) |
lc/def/lcDefConv: Use Xcalloc to avoid use of uninitialized memory
Fixed by zero'ing conv on allocation with Xcalloc. Then
close_converter works properly.
Using uninitialized value "conv->state" in call to function "close_converter"
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | modules/lc/def/lcDefConv.c | 2 | ||||
-rw-r--r-- | 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; |