File commit_a872c8a969a8bd3706253d6ba24088e4f07f3352.diff of Package kdelibs4

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
--- a/khtml/css/cssparser.cpp
+++ b/khtml/css/cssparser.cpp
@@ -2270,18 +2270,21 @@ bool CSSParser::parseFontFaceSrc()
             DOMString uri = khtml::parseURL( domString( val->string ) );
             parsedValue = new CSSFontFaceSrcValueImpl(
                               DOMString(KUrl( styleElement->baseURL(), uri.string()).url()), false /*local*/);
             uriValue = parsedValue;
             allowFormat = true;
             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;
                     Value* a = args->current();
                     uriValue = 0;
                     parsedValue = new CSSFontFaceSrcValueImpl( domString( a->string ), true /*local src*/ );
                 } else if (!strcasecmp(domString(val->function->name), "format(") && allowFormat && uriValue) {
                     expectComma = true;
openSUSE Build Service is sponsored by