diff options
author | Brett Nash <nash@nash.id.au> | 2010-07-05 04:11:53 +0000 |
---|---|---|
committer | Brett Nash <nash@nash.id.au> | 2010-07-05 04:11:53 +0000 |
commit | 1c185410b4c9e7571bca05f73e7545823f932f35 (patch) | |
tree | 095d33dde72d1e933241a1017e5cb2580f8657b9 /legacy/ecore/src/lib/ecore_file/ecore_file.c | |
parent | b895f0c07f2d5c592ef3a9c29e9bf1323c13dcbc (diff) |
Old bug: Don't suffer from buffer overflow in readlink.
SVN revision: 50040
Diffstat (limited to '')
-rw-r--r-- | legacy/ecore/src/lib/ecore_file/ecore_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
658 | char buf[PATH_MAX]; | 658 | char buf[PATH_MAX]; |
659 | int count; | 659 | int count; |
660 | 660 | ||
661 | if ((count = readlink(link, buf, sizeof(buf))) < 0) return NULL; | 661 | if ((count = readlink(link, buf, sizeof(buf) - 1)) < 0) return NULL; |
662 | buf[count] = 0; | 662 | buf[count] = 0; |
663 | return strdup(buf); | 663 | return strdup(buf); |
664 | } | 664 | } |