[evolution-activesync] calendar conversion: explicit initialization of time stamps



commit f66da94129e6b453aff847075cd54625881011eb
Author: Patrick Ohly <patrick ohly intel com>
Date:   Mon Jan 20 11:42:06 2014 +0100

    calendar conversion: explicit initialization of time stamps
    
    Well-formed data should initialize the start and end time stamps.
    Better be careful and explicitly set before checking the event.

 eas-daemon/libeas/eas-cal-info-translator.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/eas-daemon/libeas/eas-cal-info-translator.c b/eas-daemon/libeas/eas-cal-info-translator.c
index 0a8a745..0dd75a0 100644
--- a/eas-daemon/libeas/eas-cal-info-translator.c
+++ b/eas-daemon/libeas/eas-cal-info-translator.c
@@ -2272,6 +2272,12 @@ static void _ical2eas_process_vevent (icalcomponent* vevent, xmlNodePtr appData,
                //xmlNodePtr icalExtns = NULL;
                struct icaltimetype startTime, endTime;
 
+               // Should be set when iterating over properties, but better don't
+               // rely on it and initialize upfront before checking for "all day"
+               // property after the loop. Keeps static code analysis happy.
+               memset (&startTime, 0, sizeof (startTime));
+               memset (&endTime, 0, sizeof (endTime));
+
                icalproperty* prop;
                for (prop = icalcomponent_get_first_property (vevent, ICAL_ANY_PROPERTY);
                     prop;


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