diff options
author | Milan Crha <mcrha@redhat.com> | 2008-12-10 02:20:21 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-12-10 02:20:21 +0800 |
commit | 4d269fdc404863e16f62de4f301d7aca29f69f06 (patch) | |
tree | 33a19dddf91eeb260f3b7a9f6c2b2bb959cf690c | |
parent | b607fe6bee3648726f88122e4d6e3856c9ada922 (diff) | |
download | gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.tar gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.tar.gz gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.tar.bz2 gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.tar.lz gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.tar.xz gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.tar.zst gsoc2013-evolution-4d269fdc404863e16f62de4f301d7aca29f69f06.zip |
** Fix for bug #333224
2008-12-09 Milan Crha <mcrha@redhat.com>
** Fix for bug #333224
* gui/e-day-view.c: (e_day_view_on_text_item_event): Sanitize returned
values from 'e_day_view_convert_position_in_main_canvas', because it
can let the 'event_num' or 'day' set to -1, which means invalid value.
svn path=/trunk/; revision=36858
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 19 |
2 files changed, 20 insertions, 7 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 1527f8b628..4ba7876416 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,13 @@ 2008-12-09 Milan Crha <mcrha@redhat.com> + ** Fix for bug #333224 + + * gui/e-day-view.c: (e_day_view_on_text_item_event): Sanitize returned + values from 'e_day_view_convert_position_in_main_canvas', because it + can let the 'event_num' or 'day' set to -1, which means invalid value. + +2008-12-09 Milan Crha <mcrha@redhat.com> + ** Part of fix for bug #563669 * gui/dialogs/recurrence-page.glade: diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 7d54f83cbf..331b3a4132 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -5864,6 +5864,15 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, ECalendarViewPosition pos; gboolean main_canvas = TRUE; + if (day_view->editing_event_num != -1) + break; + + if (day_view->resize_event_num != -1) + break; + + if (day_view->drag_event_num != -1) + break; + /* Convert the coords to the main canvas window, or return if the window is not found. */ if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event, @@ -5892,15 +5901,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, } if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) - return FALSE; - - if (day_view->editing_event_num != -1) break; - if (day_view->resize_event_num != -1) - break; - - if (day_view->drag_event_num != -1) + /* even when returns position inside, or other, then the day and/or event_num + can be unknown, thus check for this here, otherwise it will crash later */ + if (day == -1 || event_num == -1) break; pevent = tooltip_get_view_event (day_view, day, event_num); |