Check the size of the input buffer so we don't write past the end.
This commit is contained in:
parent
036e02281c
commit
0eddf4341f
@ -544,6 +544,8 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
static const char signature[] = "FE2X";
|
||||||
|
DWORD bufsize = vvis->wLength + strlen(signature);
|
||||||
DWORD convbuf;
|
DWORD convbuf;
|
||||||
|
|
||||||
/* We have a 32bit resource.
|
/* We have a 32bit resource.
|
||||||
@ -552,8 +554,12 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
|
|||||||
* This extra buffer is used for Unicode to ANSI conversions in A-Calls
|
* This extra buffer is used for Unicode to ANSI conversions in A-Calls
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* information is truncated to datasize bytes */
|
||||||
|
if (datasize >= bufsize)
|
||||||
|
{
|
||||||
convbuf = datasize - vvis->wLength;
|
convbuf = datasize - vvis->wLength;
|
||||||
memcpy( ((char*)(data))+vvis->wLength, "FE2X", convbuf > 4 ? 4 : convbuf );
|
memcpy( ((char*)(data))+vvis->wLength, signature, convbuf > 4 ? 4 : convbuf );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user