mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug #190079. Crasher. Check length of string before calling |Last| on it. r=jkeiser,sr=scc,a=roc
This commit is contained in:
parent
325390778a
commit
a999059dd4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user