[Xfce4-commits] [apps/orage] 01/01: 4.11.2.15 Coverity fix 31696-31699 ignoring number of bytes read

noreply at xfce.org noreply at xfce.org
Tue Mar 10 10:37:54 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 a3a749357c6b43ed4999a1729a22462a80e887e5
Author: Juha Kautto <juha at xfce.org>
Date:   Tue Mar 10 11:36:37 2015 +0200

    4.11.2.15 Coverity fix 31696-31699 ignoring number of bytes read
    
    Added more checks to make sure there are no overflows.
---
 configure.in.in         |    2 +-
 src/appointment.c       |    4 +++-
 src/event-list.c        |    3 ++-
 src/reminder.c          |    4 +++-
 tz_convert/tz_convert.c |    2 +-
 5 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 921c171..df0c4eb 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.14-git])
+m4_define([orage_version], [4.11.2.15-git])
 
 m4_define([gtk_minimum_version], [2.14.0])
 m4_define([xfce_minimum_version], [4.8.0])
diff --git a/src/appointment.c b/src/appointment.c
index 8413813..7fb4862 100644
--- a/src/appointment.c
+++ b/src/appointment.c
@@ -2553,7 +2553,9 @@ static OrageRc *orage_alarm_file_open(gboolean read_only)
 
     fpath = orage_config_file_location(ORAGE_DEFAULT_ALARM_DIR_FILE);
     if (!read_only)  /* we need to empty it before each write */
-        g_remove(fpath);
+        if (g_remove(fpath)) {
+            orage_message(150, "orage_alarm_file_open: g_remove failed.");
+        }
     if ((orc = orage_rc_file_open(fpath, read_only)) == NULL) {
         orage_message(150, "orage_alarm_file_open: default alarm file open failed.");
     }
diff --git a/src/event-list.c b/src/event-list.c
index 7e04e91..6fc3ec0 100644
--- a/src/event-list.c
+++ b/src/event-list.c
@@ -658,7 +658,8 @@ static void todo_data(el_win *el)
     stime = orage_tm_time_to_icaltime(t);
     strncpy(a_day, stime, 8);
     a_day[8] = '\0';
-    strncpy(el->date_now, stime, XFICAL_APPT_TIME_FORMAT_LEN);
+    strncpy(el->date_now, stime, XFICAL_APPT_TIME_FORMAT_LEN-1);
+    el->date_now[XFICAL_APPT_TIME_FORMAT_LEN-1] = '\0';
     app_data(el, a_day, NULL);
 }
 
diff --git a/src/reminder.c b/src/reminder.c
index a14557d..b3d80cc 100644
--- a/src/reminder.c
+++ b/src/reminder.c
@@ -265,7 +265,9 @@ static OrageRc *orage_persistent_file_open(gboolean read_only)
 #endif
     fpath = orage_data_file_location(ORAGE_PERSISTENT_ALARMS_DIR_FILE);
     if (!read_only)  /* we need to empty it before each write */
-        g_remove(fpath);
+        if (g_remove(fpath)) {
+            orage_message(150, P_N "g_remove failed.");
+        }
     if ((orc = (OrageRc *)orage_rc_file_open(fpath, read_only)) == NULL) {
         orage_message(150, P_N "persistent alarms file open failed.");
     }
diff --git a/tz_convert/tz_convert.c b/tz_convert/tz_convert.c
index 5daaa52..5100fb4 100644
--- a/tz_convert/tz_convert.c
+++ b/tz_convert/tz_convert.c
@@ -1395,7 +1395,7 @@ void add_zone_tabs()
     }
 
     ical_zone_buf = malloc(ical_zone_stat.st_size+1);
-    if (!fread(ical_zone_buf, 1, ical_zone_stat.st_size, ical_zone_tab)
+    if ((fread(ical_zone_buf, 1, ical_zone_stat.st_size, ical_zone_tab) < ical_zone_stat.st_size)
     && (ferror(ical_zone_tab))) {
         printf("add_zone_tabs: error reading (%s).\n", ical_zone);
         perror("\tfread");

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


More information about the Xfce4-commits mailing list