raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=ca4c76db14887f9e36ea00afd244851a4e6cdaf8

commit ca4c76db14887f9e36ea00afd244851a4e6cdaf8
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sat Jan 11 16:41:03 2014 +0900

    elm prefs cc - fix failed lseek handling on compile
---
 src/bin/elm_prefs_cc_parse.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/bin/elm_prefs_cc_parse.c b/src/bin/elm_prefs_cc_parse.c
index 1028e5e..ce649e7 100644
--- a/src/bin/elm_prefs_cc_parse.c
+++ b/src/bin/elm_prefs_cc_parse.c
@@ -695,6 +695,12 @@ compile(void)
    DBG("Opening \"%s\" for input", file_in);
 
    size = lseek(fd, 0, SEEK_END);
+   if (size <= 0)
+     {
+        ERR("lseek failed");
+        close(fd);
+        return;
+     }
    lseek(fd, 0, SEEK_SET);
    data = malloc(size);
    if (data && (read(fd, data, size) == size))

-- 


Reply via email to