From 115d52a50995b16f02b18a124d8bbe0b38ffeade Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Thu, 23 Jan 2003 04:12:58 +0000 Subject: [PATCH] Bug #190079. Crasher. Check length of string before calling |Last| on it. r=jkeiser,sr=scc,a=roc git-svn-id: svn://10.0.0.236/trunk@136868 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsHTMLValue.cpp | 2 +- mozilla/content/shared/src/nsHTMLValue.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mozilla/content/base/src/nsHTMLValue.cpp b/mozilla/content/base/src/nsHTMLValue.cpp index 84cd4ecd4f9..142aedb8ef1 100644 --- a/mozilla/content/base/src/nsHTMLValue.cpp +++ b/mozilla/content/base/src/nsHTMLValue.cpp @@ -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 diff --git a/mozilla/content/shared/src/nsHTMLValue.cpp b/mozilla/content/shared/src/nsHTMLValue.cpp index 84cd4ecd4f9..142aedb8ef1 100644 --- a/mozilla/content/shared/src/nsHTMLValue.cpp +++ b/mozilla/content/shared/src/nsHTMLValue.cpp @@ -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