Fix buffer overflow in copying PS name

As reported on the fontconfig mailing list by Tanel Liiv.
Found using American Fuzzy Lop.
Upstream patch adapted to use strlcpy().
This commit is contained in:
matthieu 2015-01-03 16:13:16 +00:00
parent 5426d10d0b
commit 8ffe8af9da

View File

@ -1391,7 +1391,7 @@ FcFreeTypeQueryFace (const FT_Face face,
}
else
{
strcpy (psname, tmp);
strlcpy (psname, tmp, sizeof(psname));
}
if (!FcPatternAddString (pat, FC_POSTSCRIPT_NAME, (const FcChar8 *)psname))
goto bail1;