Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/crypt32/base64.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c index e25e4c10ff..5caab97b17 100644 --- a/dlls/crypt32/base64.c +++ b/dlls/crypt32/base64.c @@ -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; }