Fix crash due to unsigned integer underflow. b=100451 r=jag, harishd sr=waterson
git-svn-id: svn://10.0.0.236/trunk@103259 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
3a5782e22d
commit
9dff5d268e
@ -1063,9 +1063,11 @@ static void DetermineHTMLParseMode(nsString& aBuffer,
|
||||
publicID.ToLowerCase();
|
||||
|
||||
// binary search to see if we can find the correct public ID
|
||||
PRUint32 minimum = 0;
|
||||
PRUint32 maximum = ELEMENTS_OF(kPublicIDs) - 1;
|
||||
PRUint32 index;
|
||||
// These must be signed since maximum can go below zero and we'll
|
||||
// crash if it's unsigned.
|
||||
PRInt32 minimum = 0;
|
||||
PRInt32 maximum = ELEMENTS_OF(kPublicIDs) - 1;
|
||||
PRInt32 index;
|
||||
for (;;) {
|
||||
index = (minimum + maximum) / 2;
|
||||
PRInt32 comparison =
|
||||
|
||||
@ -1063,9 +1063,11 @@ static void DetermineHTMLParseMode(nsString& aBuffer,
|
||||
publicID.ToLowerCase();
|
||||
|
||||
// binary search to see if we can find the correct public ID
|
||||
PRUint32 minimum = 0;
|
||||
PRUint32 maximum = ELEMENTS_OF(kPublicIDs) - 1;
|
||||
PRUint32 index;
|
||||
// These must be signed since maximum can go below zero and we'll
|
||||
// crash if it's unsigned.
|
||||
PRInt32 minimum = 0;
|
||||
PRInt32 maximum = ELEMENTS_OF(kPublicIDs) - 1;
|
||||
PRInt32 index;
|
||||
for (;;) {
|
||||
index = (minimum + maximum) / 2;
|
||||
PRInt32 comparison =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user