Skip <range> elements with begin > end

This commit is contained in:
Behdad Esfahbod 2010-12-28 02:55:31 -06:00
parent 8c625aa01f
commit 43bf659eed
1 changed files with 16 additions and 10 deletions

View File

@ -1148,11 +1148,14 @@ FcParseBlank (FcConfigParse *parse)
goto bail;
break;
case FcVStackRange:
if (v->u.range.begin <= v->u.range.end)
{
for (i = v->u.range.begin; i <= v->u.range.end; i++)
{
if (!FcBlanksAdd (parse->config->blanks, i))
goto bail;
}
}
break;
default:
FcConfigMessage (parse, FcSevereError, "invalid element in blank");
@ -1428,6 +1431,8 @@ FcParseCharSet (FcConfigParse *parse)
n++;
break;
case FcVStackRange:
if (vstack->u.range.begin <= vstack->u.range.end)
{
for (i = vstack->u.range.begin; i <= vstack->u.range.end; i++)
{
if (!FcCharSetAddChar (charset, i))
@ -1437,6 +1442,7 @@ FcParseCharSet (FcConfigParse *parse)
else
n++;
}
}
break;
default:
FcConfigMessage (parse, FcSevereError, "invalid element in charset");