Bug 373900: Add a check to nsMultiMixedConv. r=honzab

This commit is contained in:
Steve Workman 2011-09-21 15:17:40 -04:00
parent 5e8f4fcbd9
commit 9282c23db2

View File

@ -485,6 +485,8 @@ nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsISupports *context,
// fill buffer
{
bufLen = count + mBufLen;
NS_ENSURE_TRUE((bufLen >= count) && (bufLen >= mBufLen),
NS_ERROR_FAILURE);
buffer = (char *) malloc(bufLen);
if (!buffer)
return NS_ERROR_OUT_OF_MEMORY;