[evolution/gnome-3-26] [Calendar] set_style_from_attendee(): Prevent crash when attendee has no mail set



commit f329b1605ffc353ecbea5db449c4e99a28aa002d
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 22 10:04:02 2017 +0100

    [Calendar] set_style_from_attendee(): Prevent crash when attendee has no mail set

 src/calendar/gui/e-day-view.c  |    4 ++--
 src/calendar/gui/e-week-view.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/gui/e-day-view.c b/src/calendar/gui/e-day-view.c
index ebfdbd6..d9e7ceb 100644
--- a/src/calendar/gui/e-day-view.c
+++ b/src/calendar/gui/e-day-view.c
@@ -3308,8 +3308,8 @@ set_style_from_attendee (EDayViewEvent *event,
        for (l = attendees; l; l = l->next) {
                ECalComponentAttendee *attendee = l->data;
 
-               if ((g_str_equal (itip_strip_mailto (attendee->value), address))
-                || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
+               if ((attendee->value && g_strcmp0 (itip_strip_mailto (attendee->value), address) == 0)
+                || (attendee->sentby && g_strcmp0 (itip_strip_mailto (attendee->sentby), address) == 0)) {
                        at = attendee;
                        break;
                }
diff --git a/src/calendar/gui/e-week-view.c b/src/calendar/gui/e-week-view.c
index b9eb2b9..917580e 100644
--- a/src/calendar/gui/e-week-view.c
+++ b/src/calendar/gui/e-week-view.c
@@ -2586,8 +2586,8 @@ set_style_from_attendee (EWeekViewEvent *event,
        for (l = attendees; l; l = l->next) {
                ECalComponentAttendee *attendee = l->data;
 
-               if ((g_str_equal (itip_strip_mailto (attendee->value), address))
-                || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
+               if ((attendee->value && g_strcmp0 (itip_strip_mailto (attendee->value), address) == 0)
+                || (attendee->sentby && g_strcmp0 (itip_strip_mailto (attendee->sentby), address) == 0)) {
                        at = attendee;
                        break;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]