Fix dereferencing null pointer

This commit is contained in:
Akira TAGOH 2018-07-19 07:55:40 +00:00
parent 1ac2218467
commit efac784b01
1 changed files with 7 additions and 6 deletions

View File

@ -2616,12 +2616,13 @@ FcRuleSetAdd (FcRuleSet *rs,
switch (r->type)
{
case FcRuleTest:
if (r->u.test &&
r->u.test->kind == FcMatchDefault)
r->u.test->kind = kind;
if (n < r->u.test->object)
n = r->u.test->object;
if (r->u.test)
{
if (r->u.test->kind == FcMatchDefault)
r->u.test->kind = kind;
if (n < r->u.test->object)
n = r->u.test->object;
}
break;
case FcRuleEdit:
if (n < r->u.edit->object)