Allocate sufficient memory to terminate with null
This commit is contained in:
parent
5ea2ab6a38
commit
a1ad5fe2ba
|
@ -953,7 +953,7 @@ FcStrCopyFilename (const FcChar8 *s)
|
||||||
if (!home)
|
if (!home)
|
||||||
return NULL;
|
return NULL;
|
||||||
size = strlen ((char *) home) + strlen ((char *) s);
|
size = strlen ((char *) home) + strlen ((char *) s);
|
||||||
full = (FcChar8 *) malloc (size);
|
full = (FcChar8 *) malloc (size + 1);
|
||||||
if (!full)
|
if (!full)
|
||||||
return NULL;
|
return NULL;
|
||||||
strcpy ((char *) full, (char *) home);
|
strcpy ((char *) full, (char *) home);
|
||||||
|
|
Loading…
Reference in New Issue