Prevent a hang by consuming entity-look-alike ( &# ) as text. b=188278, r=heikki,sr=jst
git-svn-id: svn://10.0.0.236/trunk@136261 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2039,6 +2039,12 @@ CEntityToken::ConsumeEntity(PRUnichar aChar,
|
||||
result = aScanner.Peek(theChar,2);
|
||||
|
||||
if (NS_FAILED(result)) {
|
||||
if (kEOF == result && !aScanner.IsIncremental()) {
|
||||
// If this is the last buffer then we are certainly
|
||||
// not dealing with an entity. That's, there are
|
||||
// no more characters after &#. Bug 188278.
|
||||
return NS_HTMLTOKENS_NOT_AN_ENTITY;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user