mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 538891 - Possible overflow at CEnumFormatEtc::Next. r=jmathies.
This commit is contained in:
parent
55744c00f9
commit
f35b20b502
@ -121,12 +121,12 @@ CEnumFormatEtc::Next(ULONG aMaxToFetch, FORMATETC *aResult, ULONG *aNumFetched)
|
||||
if (mCurrentIdx >= mFormatList.Length())
|
||||
return S_FALSE;
|
||||
|
||||
PRInt32 left = mFormatList.Length() - mCurrentIdx;
|
||||
PRUint32 left = mFormatList.Length() - mCurrentIdx;
|
||||
|
||||
if (!left || !aMaxToFetch)
|
||||
if (!aMaxToFetch)
|
||||
return S_FALSE;
|
||||
|
||||
PRInt32 count = NS_MIN(static_cast<PRInt32>(aMaxToFetch), left);
|
||||
PRUint32 count = NS_MIN(static_cast<PRUint32>(aMaxToFetch), left);
|
||||
|
||||
PRUint32 idx = 0;
|
||||
while (count > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user