Fix access in a null pointer dereference

This commit is contained in:
Akira TAGOH 2018-07-19 16:44:03 +09:00
parent 586ac3b6c0
commit f3981a8bcd
1 changed files with 2 additions and 2 deletions

View File

@ -748,12 +748,12 @@ FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
v.u.l = FcLangSetPromote (v.u.s, buf);
v.type = FcTypeLangSet;
}
else if (v.type == FcTypeVoid && u.type == FcTypeLangSet)
else if (buf && v.type == FcTypeVoid && u.type == FcTypeLangSet)
{
v.u.l = FcLangSetPromote (NULL, buf);
v.type = FcTypeLangSet;
}
else if (v.type == FcTypeVoid && u.type == FcTypeCharSet)
else if (buf && v.type == FcTypeVoid && u.type == FcTypeCharSet)
{
v.u.c = FcCharSetPromote (buf);
v.type = FcTypeCharSet;