diff options
author | Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> | 2011-01-31 14:02:13 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:26 +0200 |
commit | a8598e06240df4423aea79e659846409be6a75e9 (patch) | |
tree | e405fcca905fd199e37c8d3f1f730812a5f8c12f | |
parent | 93a4f5c4758f68717c4e8fa8cb346719b265319c (diff) | |
download | nx-libs-a8598e06240df4423aea79e659846409be6a75e9.tar.gz nx-libs-a8598e06240df4423aea79e659846409be6a75e9.tar.bz2 nx-libs-a8598e06240df4423aea79e659846409be6a75e9.zip |
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>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
-rw-r--r-- | nx-X11/lib/X11/lcDefConv.c | 2 | ||||
-rw-r--r-- | nx-X11/lib/X11/lcGenConv.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/nx-X11/lib/X11/lcDefConv.c b/nx-X11/lib/X11/lcDefConv.c index 5860a79a5..12a48615e 100644 --- a/nx-X11/lib/X11/lcDefConv.c +++ b/nx-X11/lib/X11/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/nx-X11/lib/X11/lcGenConv.c b/nx-X11/lib/X11/lcGenConv.c index 37aca0c25..42d63c529 100644 --- a/nx-X11/lib/X11/lcGenConv.c +++ b/nx-X11/lib/X11/lcGenConv.c @@ -2647,7 +2647,7 @@ create_conv( XlcConv conv; State state; - conv = (XlcConv) Xmalloc(sizeof(XlcConvRec)); + conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec)); if (conv == NULL) return (XlcConv) NULL; |