Commit 5652a191 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

crypt32: Fix output buffer handling for CRYPT_STRING_BINARY case.

parent d18d38bc
......@@ -77,23 +77,20 @@ static BOOL EncodeBinaryToBinaryA(const BYTE *pbBinary,
{
BOOL ret = TRUE;
if (*pcchString < cbBinary)
if (pszString)
{
if (!pszString)
*pcchString = cbBinary;
else
if (*pcchString < cbBinary)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
*pcchString = cbBinary;
ret = FALSE;
}
}
else
{
if (cbBinary)
else if (cbBinary)
memcpy(pszString, pbBinary, cbBinary);
*pcchString = cbBinary;
}
else
*pcchString = cbBinary;
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment