Allocate sufficient memory to terminate with null

This commit is contained in:
Akira TAGOH 2018-07-25 12:40:17 +09:00
parent 5ea2ab6a38
commit a1ad5fe2ba
1 changed files with 1 additions and 1 deletions

View File

@ -953,7 +953,7 @@ FcStrCopyFilename (const FcChar8 *s)
if (!home)
return NULL;
size = strlen ((char *) home) + strlen ((char *) s);
full = (FcChar8 *) malloc (size);
full = (FcChar8 *) malloc (size + 1);
if (!full)
return NULL;
strcpy ((char *) full, (char *) home);