Old bug: Don't suffer from buffer overflow in readlink.
SVN revision: 50040
This commit is contained in:
parent
b895f0c07f
commit
1c185410b4
|
@ -658,7 +658,7 @@ ecore_file_readlink(const char *link)
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
int count;
|
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;
|
buf[count] = 0;
|
||||||
return strdup(buf);
|
return strdup(buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue