[mb-devel] Possible Client SDK code bug

Andy Bridle andy at bridle.demon.co.uk
Sat Oct 21 11:47:11 UTC 2006


Sorry if this seems a bit presumptious from a newbie, and also if this isn't
the correct forum for this, but I've been getting occasional Heap Corruption
errors from the Client SDK (v2.1.4) and I think they're being caused by an
error in the code in file http.cpp.

The source for member function MBHttp::WriteToBuffer contains the following
code to calculate the new size for the dynamic buffer: 

    if (m_bytesInBuffer + size > m_bufferSize)
    {
	  .
        m_bufferSize += (kBufferSize < size) ? kBufferSize : kBufferSize +
size;
        .
    }

Which, to me, looks the wrong way round, ie it should be:

        m_bufferSize += (kBufferSize < size) ? kBufferSize + size :
kBufferSize;

But please feel free to make me look silly.

Andy B

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date: 20/10/2006
 




More information about the MusicBrainz-devel mailing list