summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-26 17:59:59 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-09-26 17:59:59 -0400
commit64799b32a155daf8bfaa001fb6faf437134699b4 (patch)
tree62c50615190227fc21439add8d33361778e8e2b8 /src/lib/eio
parenta50bd311abf725cfe7cfe85b1c387efad7ee11c3 (diff)
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
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_dir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/eio/eio_dir.c b/src/lib/eio/eio_dir.c
index 0ae68be..076d337 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,
274 /* recreate all links */ 274 /* recreate all links */
275 EINA_LIST_FOREACH(order->links, l, ln) 275 EINA_LIST_FOREACH(order->links, l, ln)
276 { 276 {
277 ssize_t length; 277 ssize_t length = -1;
278 278
279 eina_strbuf_reset(oldpath); 279 eina_strbuf_reset(oldpath);
280 280
@@ -299,7 +299,8 @@ _eio_dir_link(Ecore_Thread *thread, Eio_Dir_Copy *order,
299 } 299 }
300 300
301 /* read link target */ 301 /* read link target */
302 length = readlink(ln, target, bsz); 302 if (target)
303 length = readlink(ln, target, bsz);
303 if (length < 0) 304 if (length < 0)
304 goto on_error; 305 goto on_error;
305 306