summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@bluenote.herrb.com>2007-09-28 08:17:57 +0200
committerMatthieu Herrb <matthieu@bluenote.herrb.com>2007-09-28 08:17:57 +0200
commit5bf703700ee4a5d6eae20da07cb7a29369667aef (patch)
tree1701400c91850240845c8fed46d64c5711dcad69
parentfd8a03fbbd74f5cbaa740e5d50fccdf5c1f78b5b (diff)
catalogue.c: prevent a one character overflow
this occurs if readlink writes a result that's exactly the size of the buffer that's passed to it. Reported by Joerg Sonnenberger. Re
-rw-r--r--src/fontfile/catalogue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c
index 33d4434..c0d90f8 100644
--- a/src/fontfile/catalogue.c
+++ b/src/fontfile/catalogue.c
@@ -156,7 +156,7 @@ CatalogueRescan (FontPathElementPtr fpe)
while (entry = readdir(dir), entry != NULL)
{
snprintf(link, sizeof link, "%s/%s", path, entry->d_name);
- len = readlink(link, dest, sizeof dest);
+ len = readlink(link, dest, sizeof dest - 1);
if (len < 0)
continue;