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
parent 325390778a
commit a999059dd4
2 changed files with 2 additions and 2 deletions

View File

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

View File

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