crypt32: Check number of bytes returned by ReadFile and avoid a memory leak on error path.
This commit is contained in:
parent
71168d9dcc
commit
d95797e170
|
@ -119,7 +119,8 @@ static BOOL CRYPT_ReadBlobFromFile(HANDLE file, PCERT_BLOB blob)
|
|||
{
|
||||
DWORD read;
|
||||
|
||||
ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL);
|
||||
ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL) && read == blob->cbData;
|
||||
if (!ret) CryptMemFree(blob->pbData);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue