diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-09-26 17:59:59 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-09-26 17:59:59 -0400 |
commit | 64799b32a155daf8bfaa001fb6faf437134699b4 (patch) | |
tree | 62c50615190227fc21439add8d33361778e8e2b8 | |
parent | a50bd311abf725cfe7cfe85b1c387efad7ee11c3 (diff) | |
download | efl-64799b32a155daf8bfaa001fb6faf437134699b4.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 0ae68befde..076d337764 100644 --- a/src/lib/eio/eio_dir.c +++ b/src/lib/eio/eio_dir.c @@ -274,7 +274,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); @@ -299,7 +299,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; |