GNOME Bugzilla – Bug 771680
segfaults if drag and drop event received from some other software
Last modified: 2017-04-17 18:20:40 UTC
If Calendar receives some drag and drop event from some other application (say, a file from nautilus is DnD to some cell in Calendar), Calendar segfaults.
Created attachment 335962 [details] [review] month-view: return if dnd item isn't an event On month view, dnd received from an application other than gnome-calendar leads to segfault. This is because, gnome-calendar does not check if the received event is a valid GCAL_EVENT_WIDGET. This commit checks if the received event is a true GCAL_EVENT_WIDGET and fails otherwise.
Created attachment 335963 [details] [review] month-view: return if dnd item isn't an event On month view, dnd received from an application other than gnome-calendar leads to segfault. This is because, gnome-calendar does not check if the received event is from a valid GCAL_EVENT_WIDGET. This commit checks if the received event is from a true GCAL_EVENT_WIDGET and fails otherwise. (fix commit message in last patch)
Review of attachment 335963 [details] [review]: The code fails too aggressively - a simple check is ok for now. In the future, we'll handle ICS files being DnD'ed. Also, nice commit message! ::: src/gcal-month-view.c @@ +868,3 @@ GTimeSpan timespan = 0; + g_return_if_fail (GCAL_IS_EVENT_WIDGET (event_widget)); Failing here is a long shot. For now, we can silently cancel with: if (!GCAL_IS_EVENT_WIDGET(widget)) return;
Created attachment 335964 [details] [review] month-view: return if dnd item isn't an event On month view, dnd received from an application other than gnome-calendar leads to segfault. This is because, gnome-calendar does not check if the received event is from a valid GCAL_EVENT_WIDGET. This commit checks if the received event is from a true GCAL_EVENT_WIDGET and return otherwise.
Created attachment 336402 [details] [review] views: protect against invalid drop If the user tries to drop a e.g. file, GNOME Calendar crashes immediately. While the desired behavior would be checking if that's an ics file, lets just not crash for now.
Thanks for your fix! I merged your code with a fix for Year view too, and pushed. Attachment 336402 [details] pushed as 8187399 - views: protect against invalid drop