[Xfce4-commits] [apps/orage] 01/01: 4.11.2.12 Coverity fix 31700 and 31707 fopen and fread issues

noreply at xfce.org noreply at xfce.org
Fri Mar 6 14:20:03 CET 2015


This is an automated email from the git hooks/post-receive script.

juha pushed a commit to branch master
in repository apps/orage.

commit 098764e42d842a176c358e771005d38a714f0cbb
Author: Juha Kautto <juha at xfce.org>
Date:   Fri Mar 6 15:18:38 2015 +0200

    4.11.2.12 Coverity fix 31700 and 31707 fopen and fread issues
    
    Added more detailed error checking.
---
 configure.in.in         |    2 +-
 tz_convert/tz_convert.c |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 6d9bef0..65913f5 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.11.2.11-git])
+m4_define([orage_version], [4.11.2.12-git])
 
 m4_define([gtk_minimum_version], [2.14.0])
 m4_define([xfce_minimum_version], [4.8.0])
diff --git a/tz_convert/tz_convert.c b/tz_convert/tz_convert.c
index c92ffc4..5daaa52 100644
--- a/tz_convert/tz_convert.c
+++ b/tz_convert/tz_convert.c
@@ -133,7 +133,12 @@ void read_file(const char *file_name, const struct stat *file_stat)
     in_head = in_buf;
     in_tail = in_buf + file_stat->st_size - 1;
     file = fopen(file_name, "r");
-    if (!fread(in_buf, 1, file_stat->st_size, file))
+    if (!file) {
+        printf("read_file: file open failed (%s)\n", file_name);
+        perror("\tfopen");
+        return;
+    }
+    if (fread(in_buf, 1, file_stat->st_size, file) < file_stat->st_size)
         if (ferror(file)) {
             printf("read_file: file read failed (%s)\n", file_name);
             fclose(file);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list