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 c55ae25a78
commit fc1645a78b

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;