From: Carsten Haitzler (Rasterman) Date: Sat, 11 Jan 2014 07:41:03 +0000 (+0900) Subject: elm prefs cc - fix failed lseek handling on compile X-Git-Tag: v1.9.0-alpha1~251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca4c76db14887f9e36ea00afd244851a4e6cdaf8;p=platform%2Fupstream%2Felementary.git elm prefs cc - fix failed lseek handling on compile --- 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))