version: check for out of memory when VerInstallFileA/W converstion. (response to coverity 635)
Rob Shearman
robertshearman at gmail.com
Thu Oct 2 09:37:39 CDT 2008
2008/10/2 Aric Stewart <aric at codeweavers.com>:
> @@ -543,34 +543,50 @@ DWORD WINAPI VerInstallFileW(
> len = WideCharToMultiByte( CP_ACP, 0, srcfilename, -1, NULL, 0, NULL, NULL );
> if ((wsrcf = HeapAlloc( GetProcessHeap(), 0, len )))
> WideCharToMultiByte( CP_ACP, 0, srcfilename, -1, wsrcf, len, NULL, NULL );
> + else if (len)
> + ret = VIF_OUTOFMEMORY;
IIRC HeapAlloc(..., 0) returns a non-NULL value, so the "if (len)"
part is not needed.
...
> + rc = VerInstallFileA(0x0, "in.txt", "out.txt", "C:\\windows\\temp", "C:\\windows\\temp\\test\\", "C:\\", tmpname, &size);
> + ok (rc == 0x10000 && tmpname[0]==0," expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
You shouldn't hard-code paths such as this.
--
Rob Shearman
More information about the wine-devel
mailing list