[PATCH 1/5] crypt32: Test CryptStringToBinary with weird base64.

Alexandre Julliard julliard at winehq.org
Tue Feb 14 03:16:30 CST 2017


Lauri Kenttä <lauri.kentta at gmail.com> writes:

> +static void decodeBase64WithLenFmt(LPCSTR str, int len, DWORD fmt, LPCSTR expected, int le, BOOL isBroken)
> +{
> +    BYTE buf[8] = {0};
> +    DWORD bufLen = sizeof(buf), fmtUsed;
> +    BOOL ret;
> +    SetLastError(0);

Something like 0xdeadbeef would be better.

> +    ret = pCryptStringToBinaryA(str, len, fmt, buf, &bufLen, NULL, &fmtUsed);
> +    buf[bufLen] = 0;

This will overflow the buffer if the length hasn't been set.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list