Prevent a hang by consuming entity-look-alike ( &# ) as text. b=188278, r=heikki,sr=jst

This commit is contained in:
harishd%netscape.com 2003-01-13 22:05:52 +00:00
Родитель 88d2586728
Коммит 5a449b70c9
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

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

Просмотреть файл

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