From a1ad5fe2ba3d742f79d601a1149e1456e57ff51e Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Wed, 25 Jul 2018 12:40:17 +0900 Subject: [PATCH] Allocate sufficient memory to terminate with null --- src/fcstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fcstr.c b/src/fcstr.c index 4d33ea5..bfddd68 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -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);