From f183d856051a709d2ea4bb132b4df3945c8bcfdc Mon Sep 17 00:00:00 2001 From: "timeless@mozdev.org" Date: Wed, 28 Apr 2010 17:58:00 -0700 Subject: [PATCH] Bug 562528 - comparison between signed and unsigned integer expressions in nsEscapeHTML2, r=bsmedberg --HG-- extra : rebase_source : 995cb88bc3bdb692ea154be2ebee597b0f777e58 --- xpcom/io/nsEscape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/io/nsEscape.cpp b/xpcom/io/nsEscape.cpp index 69fc3df5f6a..420ac48183e 100644 --- a/xpcom/io/nsEscape.cpp +++ b/xpcom/io/nsEscape.cpp @@ -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;