forked from enlightenment/efl
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:
parent
a50bd311ab
commit
64799b32a1
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue