From kde-commits Mon Feb 06 12:20:33 2012 From: Maks Orlovich Date: Mon, 06 Feb 2012 12:20:33 +0000 To: kde-commits Subject: [kdelibs/KDE/4.8] khtml/css: Fix some error checking problems in font src() descriptors Message-Id: <20120206122033.EC2F2A60A6 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=132853104012606 Git commit a872c8a969a8bd3706253d6ba24088e4f07f3352 by Maks Orlovich. Committed on 06/02/2012 at 13:08. Pushed by orlovich into branch 'KDE/4.8'. Fix some error checking problems in font src() descriptors M +4 -1 khtml/css/cssparser.cpp http://commits.kde.org/kdelibs/a872c8a969a8bd3706253d6ba24088e4f07f3352 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;