Bug #190079. Crasher. Check length of string before calling |Last| on it. r=jkeiser,sr=scc,a=roc

This commit is contained in:
blizzard%redhat.com 2003-01-23 04:12:58 +00:00
Родитель 325390778a
Коммит a999059dd4
2 изменённых файлов: 2 добавлений и 2 удалений

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

@ -469,7 +469,7 @@ nsHTMLValue::ParseIntValue(const nsAString& aString,
// Even if the integer could not be parsed, it might just be "*"
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
if (tmp.Last() == '*' && tmp.Length() == 1) {
if (tmp.Length() == 1 && tmp.Last() == '*') {
// special case: HTML spec says a value '*' == '1*'
// see http://www.w3.org/TR/html4/types.html#type-multi-length
// b=29061

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

@ -469,7 +469,7 @@ nsHTMLValue::ParseIntValue(const nsAString& aString,
// Even if the integer could not be parsed, it might just be "*"
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
if (tmp.Last() == '*' && tmp.Length() == 1) {
if (tmp.Length() == 1 && tmp.Last() == '*') {
// special case: HTML spec says a value '*' == '1*'
// see http://www.w3.org/TR/html4/types.html#type-multi-length
// b=29061