Old bug: Don't suffer from buffer overflow in readlink.

SVN revision: 50040
This commit is contained in:
Brett Nash 2010-07-05 04:11:53 +00:00
parent b895f0c07f
commit 1c185410b4
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}