jihoon pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=49511730d72aa24c1474dd2d3b0f1e0f5ab5cfd8

commit 49511730d72aa24c1474dd2d3b0f1e0f5ab5cfd8
Author: Jihoon Kim <[email protected]>
Date:   Mon Dec 2 09:40:48 2013 +0900

    fix unchecked return value of stat in ecore_file_mv
    
    stat() function may fail and return an error code
    
    This fixes CID 1039697
---
 src/lib/ecore_file/ecore_file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 7a42cb2..634709f 100644
--- a/src/lib/ecore_file/ecore_file.c
+++ b/src/lib/ecore_file/ecore_file.c
@@ -591,7 +591,8 @@ ecore_file_mv(const char *src, const char *dst)
 
              // Make sure this is a regular file before
              // we do anything fancy.
-             stat(src, &st);
+             if (stat(src, &st) == -1)
+                 goto FAIL;
              if (S_ISREG(st.st_mode))
                {
                   char *dir;

-- 


Reply via email to