Commit a8598e06 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Ulrich Sibiller

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: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: 's avatarErkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: 's avatarAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 93a4f5c4
...@@ -577,7 +577,7 @@ create_conv( ...@@ -577,7 +577,7 @@ create_conv(
XlcConv conv; XlcConv conv;
State state; State state;
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec)); conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec));
if (conv == NULL) if (conv == NULL)
return (XlcConv) NULL; return (XlcConv) NULL;
......
...@@ -2647,7 +2647,7 @@ create_conv( ...@@ -2647,7 +2647,7 @@ create_conv(
XlcConv conv; XlcConv conv;
State state; State state;
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec)); conv = (XlcConv) Xcalloc(1, sizeof(XlcConvRec));
if (conv == NULL) if (conv == NULL)
return (XlcConv) NULL; return (XlcConv) NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment