#28 Avoiding hang on some recurrence rules

closed
nobody
None
5
2011-10-27
2011-10-27
Kent
No

The following event will hang:

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Apple Inc.//iOS 5.0//EN
VERSION:2.0
BEGIN:VEVENT
DTEND;VALUE=DATE:20111125
DTSTART;VALUE=DATE:20111124
RRULE:FREQ=YEARLY;BYDAY=4TH;BYMONTHDAY=24;BYMONTH=11
SEQUENCE:0
SUMMARY:Thanksgiving
TRANSP:TRANSPARENT
UID:1DC8B703-AC1F-4797-BB0F-1A7ABEA57C04
END:VEVENT
END:VCALENDAR

expand_year_days treats the BYDAY part of the RRULE as a the 4th Thursday of the year rather than the 4th Thursday of November, which the creator probably expected. I'm fairly sure the current implementation is correct and this recurrence is just invalid, the only problem is this RRULE will cause icalrecur_iterator_new to hang. I changed the infinite for loop to bail after the year 20000 to avoid hanging.

Discussion

  • Allen Winter
    Allen Winter
    2011-10-27

    thanks for the patch.
    committed in r1113

     
  • Allen Winter
    Allen Winter
    2011-10-27

    • status: open --> closed