If a binary file is being downloaded using chunked Transfer-Encoding, and the binary file contains a null character, this line in ReadChunkedBody will only append some of the result_buffer to m_current, because Append with no length uses strlen, which
will stop at the null. Later attempts to use m_current can cause access violations because GetBodyLength() still returns the actual download size.
Changing it to this, fixes the problem:
if ( !m_current.Append((LPCSTR)result_buffer, result_buffer.GetLength()) )
Not a bug, but I also added this code in ReadChunkedBody just after a successful Read so that callback clients will get feedback during a chunked download.
bool bRet = m_pNavData->pfnReadStatusCallback(dwReadBuffSize, m_pNavData->m_lParamRead);