From kde-commits Wed Feb 08 13:16:44 2012 From: Maks Orlovich Date: Wed, 08 Feb 2012 13:16:44 +0000 To: kde-commits Subject: [kdelibs/KDE/4.7] khtml/css: Fix some error checking problems in font src() descriptors Message-Id: <20120208131644.EAE8FA60A6 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132870702512574 Git commit 3288e0fd78b964676254db5e9df6d152fce519a9 by Maks Orlovich. Committed on 06/02/2012 at 13:08. Pushed by orlovich into branch 'KDE/4.7'. Fix some error checking problems in font src() descriptors M +4 -1 khtml/css/cssparser.cpp http://commits.kde.org/kdelibs/3288e0fd78b964676254db5e9df6d152fce519a9 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 =3D true; } else if (val->unit =3D=3D Value::Function) { // There are two allowed functions: local() and format(). + // For both we expect a string argument ValueList *args =3D val->function->args; - if (args && args->size() =3D=3D 1) { + if (args && args->size() =3D=3D 1 && + (args->current()->unit =3D=3D CSSPrimitiveValue::CSS_STRIN= G || + args->current()->unit =3D=3D CSSPrimitiveValue::CSS_IDENT= )) { if (!strcasecmp(domString(val->function->name), "local(") = && !expectComma) { expectComma =3D true; allowFormat =3D false;