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,10 +1148,13 @@ FcParseBlank (FcConfigParse *parse)
goto bail; goto bail;
break; break;
case FcVStackRange: case FcVStackRange:
for (i = v->u.range.begin; i <= v->u.range.end; i++) if (v->u.range.begin <= v->u.range.end)
{ {
if (!FcBlanksAdd (parse->config->blanks, i)) for (i = v->u.range.begin; i <= v->u.range.end; i++)
goto bail; {
if (!FcBlanksAdd (parse->config->blanks, i))
goto bail;
}
} }
break; break;
default: default:
@ -1428,14 +1431,17 @@ FcParseCharSet (FcConfigParse *parse)
n++; n++;
break; break;
case FcVStackRange: case FcVStackRange:
for (i = vstack->u.range.begin; i <= vstack->u.range.end; i++) if (vstack->u.range.begin <= vstack->u.range.end)
{ {
if (!FcCharSetAddChar (charset, i)) for (i = vstack->u.range.begin; i <= vstack->u.range.end; i++)
{ {
FcConfigMessage (parse, FcSevereWarning, "invalid character: 0x%04x", i); if (!FcCharSetAddChar (charset, i))
} {
else FcConfigMessage (parse, FcSevereWarning, "invalid character: 0x%04x", i);
n++; }
else
n++;
}
} }
break; break;
default: default: