Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#20 enless loop in recurrence calculation

closed
nobody
None
5
2011-03-09
2011-02-10
No

While receiving a meeting request from Novell Groupwise (PRODID:-//Novell Inc//Groupwise 7.0.3 ), the timezone definition looked like this:

---
BEGIN:VTIMEZONE
TZID:(GMT+0100) West-Europa (standaardtijd)
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:20001030T000000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=255SU;BYMONTH=10
TZNAME:West-Europa (standaardtijd)
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:20000327T000000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=255SU;BYMONTH=3
TZNAME:West-Europa (zomertijd)
END:DAYLIGHT
END:VTIMEZONE
---

Please note the BYDAY=255SU. Obviously being processed as unsigned, the -1 turned into 255. This causes an endless loop in ical, which I fixed by limiting the value that can be set in BYDAY to a char instead of an int.
I also wanted to add some other sanity checks on the value, but wasn't really sure if anything other than -1, 1-5 would be possible. maybe you can even have -5 through -1 too?

Discussion

  • parse byday value as char instead of int.

     
    • status: open --> closed
     
  • patched in svn r1044