mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Work around crashes at ChildIterator::get using bounds check on ChildIterator::seek. sr=waterson r=kin a=asa b=133219
This commit is contained in:
parent
17bc6e66e4
commit
020c118cfd
@ -125,8 +125,9 @@ public:
|
||||
}
|
||||
|
||||
void seek(PRUint32 aIndex) {
|
||||
#ifdef DEBUG
|
||||
// Make sure that aIndex is reasonable
|
||||
// Make sure that aIndex is reasonable. This should be |#ifdef
|
||||
// DEBUG|, but we need these numbers for the temporary workaround
|
||||
// for bug 133219.
|
||||
PRUint32 length;
|
||||
if (mNodes)
|
||||
mNodes->GetLength(&length);
|
||||
@ -134,7 +135,10 @@ public:
|
||||
mContent->ChildCount(NS_REINTERPRET_CAST(PRInt32&, length));
|
||||
|
||||
NS_ASSERTION(PRInt32(aIndex) >= 0 && aIndex <= length, "out of bounds");
|
||||
#endif
|
||||
|
||||
// Temporary workaround for bug 133219.
|
||||
if (aIndex > length)
|
||||
aIndex = length;
|
||||
|
||||
mIndex = aIndex;
|
||||
}
|
||||
|
@ -125,8 +125,9 @@ public:
|
||||
}
|
||||
|
||||
void seek(PRUint32 aIndex) {
|
||||
#ifdef DEBUG
|
||||
// Make sure that aIndex is reasonable
|
||||
// Make sure that aIndex is reasonable. This should be |#ifdef
|
||||
// DEBUG|, but we need these numbers for the temporary workaround
|
||||
// for bug 133219.
|
||||
PRUint32 length;
|
||||
if (mNodes)
|
||||
mNodes->GetLength(&length);
|
||||
@ -134,7 +135,10 @@ public:
|
||||
mContent->ChildCount(NS_REINTERPRET_CAST(PRInt32&, length));
|
||||
|
||||
NS_ASSERTION(PRInt32(aIndex) >= 0 && aIndex <= length, "out of bounds");
|
||||
#endif
|
||||
|
||||
// Temporary workaround for bug 133219.
|
||||
if (aIndex > length)
|
||||
aIndex = length;
|
||||
|
||||
mIndex = aIndex;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user