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:
harishd%netscape.com
2003-01-13 22:05:52 +00:00
parent 3bbfb2a13d
commit d2e0c6cd0d
2 changed files with 12 additions and 0 deletions

View File

@@ -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;
}