Truncate version data if provided buffer is not large enough.
This commit is contained in:
parent
ed739334f4
commit
f7e7cd4aec
|
@ -325,7 +325,9 @@ static DWORD WINAPI VERSION_GetFileVersionInfo_PE( LPCSTR filename, LPDWORD hand
|
||||||
|
|
||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
if(datasize >= len)
|
if(datasize < len)
|
||||||
|
len = datasize; /* truncate data */
|
||||||
|
if(len)
|
||||||
memcpy(data, buf, len);
|
memcpy(data, buf, len);
|
||||||
else
|
else
|
||||||
len = 0xFFFFFFFF;
|
len = 0xFFFFFFFF;
|
||||||
|
@ -405,7 +407,9 @@ static DWORD WINAPI VERSION_GetFileVersionInfo_16( LPCSTR filename, LPDWORD hand
|
||||||
|
|
||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
if(datasize >= len)
|
if(datasize < len)
|
||||||
|
len = datasize; /* truncate data */
|
||||||
|
if(len)
|
||||||
memcpy(data, buf, len);
|
memcpy(data, buf, len);
|
||||||
else
|
else
|
||||||
len = 0xFFFFFFFF;
|
len = 0xFFFFFFFF;
|
||||||
|
|
Loading…
Reference in New Issue