Yesterday we encountered a fairly nasty bug in which a user had entered
in a calendar item with an end date that was before the begin date. This
had the effect of causing a section of the _get_months_events function
to go into an infinite loop accompanied by a fairly significant memory
leak that brought our site down for about 8 hours until we finally
figured out what it was.

I checked out a fresh copy of Scoop from CVS to make sure I wasn't
patching something that had already been fixed, but it appears that this
problem hasn't been addressed. It's hard for me to believe that no one
had encountered this particular bug before, so perhaps there's something
unique about our server that would cause this sort of issue.

That said, there are 4 files attached:

1. backwards_date_range_no_loop.patch

This patch prevents calendar events marked with end dates before start
dates from putting Scoop into an infinite loop and exhausting all
available memory.

2. backwards_date_range_validation.patch

This patch prevents calendar events from being added to the database if
their ending date occurs before their start date.

3. bad_event_end_date_validation.patch

_save_event contains an apparent typo in the end date validation,
testing the event start day to determine if it is greater than 0,
rather than the event end day.

4. fix_bogus_compare.patch

On line 894 of Calendar.pm, a != operator is used to compare strings
rather than the 'ne' operator. This patch fixes that.

Hope this helps,

w
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: backwards_date_range_no_loop.patch
Url: http://lists.kuro5hin.org/pipermail/scoop-dev/attachments/20071030/6b5b7197/attachment.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: backwards_date_range_validation.patch
Url: http://lists.kuro5hin.org/pipermail/scoop-dev/attachments/20071030/6b5b7197/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bad_event_end_date_validation.patch
Url: http://lists.kuro5hin.org/pipermail/scoop-dev/attachments/20071030/6b5b7197/attachment-0001.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix_bogus_compare.patch
Url: http://lists.kuro5hin.org/pipermail/scoop-dev/attachments/20071030/6b5b7197/attachment-0002.pl