зеркало из https://github.com/mozilla/pjs.git
Prevent a hang by consuming entity-look-alike ( &# ) as text. b=188278, r=heikki,sr=jst
This commit is contained in:
Родитель
88d2586728
Коммит
5a449b70c9
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче