src/fcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2f311c562d87c0bf95d27709e82afd196c2bff28 Author: Akira TAGOH <akira@xxxxxxxxx> Date: Tue Mar 3 11:30:12 2015 +0900 Fix the array allocation diff --git a/src/fcstat.c b/src/fcstat.c index d444bf9..1734fa4 100644 --- a/src/fcstat.c +++ b/src/fcstat.c @@ -219,7 +219,7 @@ FcScandir (const char *dirp, dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1)); p = (struct dirent *) malloc (dentlen); memcpy (p, dent, dentlen); - if (n >= lsize) + if ((n + 1) >= lsize) { lsize += 128; dlp = (struct dirent **) realloc (dlist, sizeof (struct dirent *) * lsize); _______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/fontconfig