From: Gerald Pfeifer Subject: oleaut32: Handle xbuf_get erroring out in deserialize_param (and avoid uninitialized read). Message-Id: Date: Mon, 19 Sep 2016 09:46:36 +0200 (CEST) GCC trunk started to warn as follows a week or two ago tmarshal.c:1092:3: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized] tmarshal.c:1082:3: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized] and looking into the source in case of an error in xbuf_get, the variable x indeed is not set. Gerald Signed-off-by: Gerald Pfeifer --- dlls/oleaut32/tmarshal.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 5fd1fdd..3738588 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -1078,7 +1078,10 @@ deserialize_param( if (readit) { DWORD x; hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD)); - if (hres) ERR("Failed to read integer 4 byte\n"); + if (hres) { + ERR("Failed to read integer 4 byte\n"); + x = 0; + } memcpy(arg,&x,2); } if (debugout) TRACE_(olerelay)("%04x",*arg & 0xffff); @@ -1088,7 +1091,10 @@ deserialize_param( if (readit) { DWORD x; hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD)); - if (hres) ERR("Failed to read integer 4 byte\n"); + if (hres) { + ERR("Failed to read integer 4 byte\n"); + x = 0; + } memcpy(arg,&x,1); } if (debugout) TRACE_(olerelay)("%02x",*arg & 0xff); -- 2.9.2