Lauri Kenttä lauri.kentta@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.