jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=37313986226c5ec05375ff6ae394585085efe211

commit 37313986226c5ec05375ff6ae394585085efe211
Author: Yeongjong Lee <[email protected]>
Date:   Mon Jan 28 17:26:09 2019 +0900

    edje_cc: check return value of fseeks
    
    Reviewers: Jaehyun_Cho, zmike
    
    Reviewed By: Jaehyun_Cho
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D7796
---
 src/bin/edje/edje_cc_out.c     | 3 ++-
 src/bin/edje/edje_cc_sources.c | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index c791e8d1c6..90c7d8f46c 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -2190,7 +2190,8 @@ data_thread_script(void *data, Ecore_Thread *thread 
EINA_UNUSED)
         return;
      }
 
-   fseek(f, 0, SEEK_END);
+   if (fseek(f, 0, SEEK_END) < 0)
+     ERR("Error seeking");
    size = ftell(f);
    rewind(f);
 
diff --git a/src/bin/edje/edje_cc_sources.c b/src/bin/edje/edje_cc_sources.c
index a8bd949576..25ed765c02 100644
--- a/src/bin/edje/edje_cc_sources.c
+++ b/src/bin/edje/edje_cc_sources.c
@@ -63,9 +63,11 @@ source_fetch_file(const char *fil, const char *filname)
         exit(-1);
      }
 
-   fseek(f, 0, SEEK_END);
+   if (fseek(f, 0, SEEK_END) < 0)
+     ERR("Error seeking");
    sz = ftell(f);
-   fseek(f, 0, SEEK_SET);
+   if (fseek(f, 0, SEEK_SET) < 0)
+     ERR("Error seeking");
    sf = mem_alloc(SZ(SrcFile));
    sf->name = mem_strdup(filname);
    sf->file = mem_alloc(sz + 1);
@@ -80,7 +82,8 @@ source_fetch_file(const char *fil, const char *filname)
      }
 
    sf->file[sz] = '\0';
-   fseek(f, 0, SEEK_SET);
+   if (fseek(f, 0, SEEK_SET) < 0)
+     ERR("Error seeking");
    srcfiles.list = eina_list_append(srcfiles.list, sf);
 
    while (fgets(buf, sizeof(buf), f))

-- 


Reply via email to