From 1c185410b4c9e7571bca05f73e7545823f932f35 Mon Sep 17 00:00:00 2001 From: Brett Nash Date: Mon, 5 Jul 2010 04:11:53 +0000 Subject: [PATCH] Old bug: Don't suffer from buffer overflow in readlink. SVN revision: 50040 --- legacy/ecore/src/lib/ecore_file/ecore_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c index 065f8bab19..58eb1d6355 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c @@ -658,7 +658,7 @@ ecore_file_readlink(const char *link) char buf[PATH_MAX]; int count; - if ((count = readlink(link, buf, sizeof(buf))) < 0) return NULL; + if ((count = readlink(link, buf, sizeof(buf) - 1)) < 0) return NULL; buf[count] = 0; return strdup(buf); }