summaryrefslogtreecommitdiff
path: root/src/fcstat.c
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2015-03-03 11:30:12 +0900
committerAkira TAGOH <akira@tagoh.org>2015-03-03 11:30:12 +0900
commit2f311c562d87c0bf95d27709e82afd196c2bff28 (patch)
tree7d09e866214002501da55936bc6d1acc4f8734f6 /src/fcstat.c
parentf18f2f88f287a2438d2bf9b27773cb14606cbb11 (diff)
downloadfontconfig-2f311c562d87c0bf95d27709e82afd196c2bff28.tar.gz
Fix the array allocation
Diffstat (limited to 'src/fcstat.c')
-rw-r--r--src/fcstat.c2
1 files changed, 1 insertions, 1 deletions
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);