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
This commit is contained in:
Mike Blumenkrantz 2019-09-26 17:59:59 -04:00
parent a50bd311ab
commit 64799b32a1
1 changed files with 3 additions and 2 deletions

View File

@ -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;