Commit 38569f2f authored by Akira TAGOH's avatar Akira TAGOH

Fix allocating insufficient memory for terminating null of the string

parent b1762935
......@@ -334,8 +334,8 @@ FcNameConvert (FcType type, FcChar8 *string)
size_t len = strlen ((const char *) string);
int si, ei;
sc = malloc (len);
ec = malloc (len);
sc = malloc (len + 1);
ec = malloc (len + 1);
if (sc && ec && sscanf ((char *) string, "[%s %[^]]]", sc, ec) == 2)
{
if (FcNameConstant ((const FcChar8 *) sc, &si) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment