crypt32: Terminate reading a serialized store upon reading an empty property.

This commit is contained in:
Juan Lang 2010-06-15 12:17:30 -07:00 committed by Alexandre Julliard
parent ecbb3c3f18
commit 02b9e3198a
1 changed files with 4 additions and 2 deletions

View File

@ -472,7 +472,9 @@ static BOOL CRYPT_ReadSerializedStore(void *handle,
buf = CryptMemAlloc(propHdr.cb);
bufSize = propHdr.cb;
}
if (buf)
if (!propHdr.cb)
; /* Property is empty, nothing to do */
else if (buf)
{
ret = read_func(handle, buf, propHdr.cb, &read);
if (ret && read == propHdr.cb)
@ -516,7 +518,7 @@ static BOOL CRYPT_ReadSerializedStore(void *handle,
else
ret = FALSE;
}
} while (ret && read > 0);
} while (ret && read > 0 && propHdr.cb);
if (contextInterface && context)
{
/* Free the last context added */