[evolution/gnome-3-10] icalendar-importer: Fix a crash when importing with no existing cals
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-10] icalendar-importer: Fix a crash when importing with no existing cals
- Date: Wed, 4 Dec 2013 13:53:37 +0000 (UTC)
commit 638dff3e3e04ed112595e775407f35f59b1c04a3
Author: Philip Withnall <philip withnall collabora co uk>
Date: Fri Nov 29 11:25:34 2013 +0000
icalendar-importer: Fix a crash when importing with no existing cals
This is a theoretical crash (not actually reproduced) caused by calling
g_object_ref(source) when source is NULL, which can happen if no
calendars or task lists exist.
This fixes the crash, but there may be UI bugs if this condition is
reached.
Found by scan-build.
https://bugzilla.gnome.org/719540
(cherry picked from commit d6e2d993bba77ad5965961c534ffe73cae39511a)
calendar/importers/icalendar-importer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 2368643..00e5895 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -363,7 +363,7 @@ ivcal_getwidget (EImport *ei,
if (!group)
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (rb));
- if (first == NULL) {
+ if (first == NULL && source != NULL) {
g_datalist_set_data_full (&target->data, "primary-source", g_object_ref (source),
g_object_unref);
g_datalist_set_data (&target->data, "primary-type", GINT_TO_POINTER
(import_type_map[i]));
first = rb;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]