[Xfce4-commits] [apps/orage] 01/01: 4.11.2.19 Coverity fix 31707 and 31700 copy into fixed size without count

noreply at xfce.org noreply at xfce.org
Wed Mar 11 12:14:49 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 da0ea1ae432e15b75c4599a91e89a5a3e9b86041
Author: Juha Kautto <juha at xfce.org>
Date:   Wed Mar 11 13:13:34 2015 +0200

    4.11.2.19 Coverity fix 31707 and 31700 copy into fixed size without count
    
    Added null check and changed strcpy tp strncpy
---
 configure.in.in        |    2 +-
 src/tz_zoneinfo_read.c |    9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index fa89f25..61b7ace 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.18-git])
+m4_define([orage_version], [4.11.2.19-git])
 
 m4_define([gtk_minimum_version], [2.14.0])
 m4_define([xfce_minimum_version], [4.8.0])
diff --git a/src/tz_zoneinfo_read.c b/src/tz_zoneinfo_read.c
index c18ed44..150e99b 100644
--- a/src/tz_zoneinfo_read.c
+++ b/src/tz_zoneinfo_read.c
@@ -146,7 +146,12 @@ static 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 error (%s)\n", file_name);
+            perror("\tfread");
+            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);
@@ -896,7 +901,7 @@ static void read_ical_timezones(void)
         return;
     }
     zones_tab_buf = malloc(zones_tab_file_stat.st_size+1);
-    if (!fread(zones_tab_buf, 1, zones_tab_file_stat.st_size, zones_tab_file)
+    if ((fread(zones_tab_buf, 1, zones_tab_file_stat.st_size, zones_tab_file) < zones_tab_file_stat.st_size)
     && (ferror(zones_tab_file))) {
         printf("read_ical_timezones: zones.tab file read failed (%s)\n"
                 , ICAL_ZONES_TAB_FILE_LOC);

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


More information about the Xfce4-commits mailing list