diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-09-26 17:59:59 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-10-04 09:54:06 -0400 |
commit | 4df9fe30868f9641411e743933d11c319da069e4 (patch) | |
tree | 52fe454c008d096312f609c74918bae204299ebf | |
parent | 650ab8f496eee92596348c2d54ff4bb8089015ea (diff) | |
download | efl-4df9fe30868f9641411e743933d11c319da069e4.tar.gz |
eio/dir: fix null deref
Summary:
above cases may fail, causing target to be null
CID 1399103
Depends on D10210
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10211
-rw-r--r-- | src/lib/eio/eio_dir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/eio/eio_dir.c b/src/lib/eio/eio_dir.c index 68412b6f8a..2d31f18674 100644 --- a/src/lib/eio/eio_dir.c +++ b/src/lib/eio/eio_dir.c @@ -268,7 +268,7 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order, /* recreate all links */ EINA_LIST_FOREACH(order->links, l, ln) { - ssize_t length; + ssize_t length = -1; eina_strbuf_reset(oldpath); @@ -293,7 +293,8 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order, } /* read link target */ - length = readlink(ln, target, bsz); + if (target) + length = readlink(ln, target, bsz); if (length < 0) goto on_error; |