crypt32: Be more strict about format of serialized store files.
This commit is contained in:
parent
15cab33041
commit
661525c606
|
@ -431,7 +431,11 @@ BOOL CRYPT_ReadSerializedStoreFromFile(HANDLE file, HCERTSTORE store)
|
|||
ret = ReadFile(file, fileHeaderBuf, sizeof(fileHeaderBuf), &read, NULL);
|
||||
if (ret)
|
||||
{
|
||||
if (!memcmp(fileHeaderBuf, fileHeader, read))
|
||||
if (!read)
|
||||
; /* an empty file is okay */
|
||||
else if (read != sizeof(fileHeaderBuf))
|
||||
ret = FALSE;
|
||||
else if (!memcmp(fileHeaderBuf, fileHeader, read))
|
||||
{
|
||||
WINE_CERT_PROP_HEADER propHdr;
|
||||
const void *context = NULL;
|
||||
|
@ -503,6 +507,8 @@ BOOL CRYPT_ReadSerializedStoreFromFile(HANDLE file, HCERTSTORE store)
|
|||
CryptMemFree(buf);
|
||||
ret = TRUE;
|
||||
}
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
ret = TRUE;
|
||||
|
|
Loading…
Reference in New Issue