Bug 562528 - comparison between signed and unsigned integer expressions in nsEscapeHTML2, r=bsmedberg

--HG--
extra : rebase_source : 995cb88bc3bdb692ea154be2ebee597b0f777e58
This commit is contained in:
timeless@mozdev.org 2010-04-28 17:58:00 -07:00
parent 892951ebdb
commit f183d85605

View File

@ -289,12 +289,12 @@ NS_COM PRUnichar *
nsEscapeHTML2(const PRUnichar *aSourceBuffer, PRInt32 aSourceBufferLen)
{
// if the caller didn't calculate the length
if (aSourceBufferLen == -1) {
if (aSourceBufferLen < 0) {
aSourceBufferLen = nsCRT::strlen(aSourceBuffer); // ...then I will
}
/* XXX Hardcoded max entity len. */
if (aSourceBufferLen >=
if (PRUint32(aSourceBufferLen) >=
((PR_UINT32_MAX - sizeof(PRUnichar)) / (6 * sizeof(PRUnichar))) )
return nsnull;