File commit_a872c8a969a8bd3706253d6ba24088e4f07f3352.diff of Package kdelibs4.openSUSE_12.1_Update
commit a872c8a969a8bd3706253d6ba24088e4f07f3352
Author: Maks Orlovich <maksim@kde.org>
Date: Mon Feb 6 07:08:53 2012 -0500
Fix some error checking problems in font src() descriptors
diff --git a/khtml/css/cssparser.cpp b/khtml/css/cssparser.cpp
index 7559db3..c7472ba 100644
--- a/khtml/css/cssparser.cpp
+++ b/khtml/css/cssparser.cpp
@@ -2275,8 +2275,11 @@ bool CSSParser::parseFontFaceSrc()
expectComma = true;
} else if (val->unit == Value::Function) {
// There are two allowed functions: local() and format().
+ // For both we expect a string argument
ValueList *args = val->function->args;
- if (args && args->size() == 1) {
+ if (args && args->size() == 1 &&
+ (args->current()->unit == CSSPrimitiveValue::CSS_STRING ||
+ args->current()->unit == CSSPrimitiveValue::CSS_IDENT)) {
if (!strcasecmp(domString(val->function->name), "local(") && !expectComma) {
expectComma = true;
allowFormat = false;