From: Colin Leroy Date: Mon, 21 Apr 2014 09:02:45 +0000 (+0200) Subject: Fix bug #313, "Crash on reccurent events with no DTSTART" X-Git-Tag: 3.10.0~150 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=bd7c33e92da9c2e196113774ccd79a0a0d390a63 Fix bug #313, "Crash on reccurent events with no DTSTART" --- diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c index 579349b0a..63245b06b 100644 --- a/src/plugins/vcalendar/vcal_folder.c +++ b/src/plugins/vcalendar/vcal_folder.c @@ -548,7 +548,7 @@ static gint feed_fetch(FolderItem *fitem, MsgNumberList ** list, gboolean *old_u prop = icalcomponent_get_first_property(evt, ICAL_DTSTART_PROPERTY); if (prop) { ritr = icalrecur_iterator_new(recur, icalproperty_get_dtstart(prop)); - next = icalrecur_iterator_next(ritr); /* skip first one */ + next = icalrecur_iterator_next(ritr); /* skip first one */ } rprop = rprop2; @@ -606,7 +606,7 @@ add_new: item->evtlist = g_slist_prepend(item->evtlist, data); data = NULL; } - if (rprop) { + if (rprop && ritr) { struct icaldurationtype ical_dur; struct icaltimetype dtstart, dtend; evt = icalcomponent_new_clone(evt); @@ -622,7 +622,7 @@ add_new: if (prop) dtend = icalproperty_get_dtend(prop); ical_dur = icaltime_subtract(dtend, dtstart); - next = icalrecur_iterator_next(ritr); + next = icalrecur_iterator_next(ritr); if (!icaltime_is_null_time(next) && !icaltime_is_null_time(dtstart) && i < 100) { prop = icalcomponent_get_first_property(evt, ICAL_DTSTART_PROPERTY);