[evolution-kolab/gnome-3-8] ECalBackendKolab: workaround E-D-S issue with NULL *calobj



commit 0322bad5ba583a0ac395752362695afd124350e7
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Apr 16 11:12:11 2013 +0200

    ECalBackendKolab: workaround E-D-S issue with NULL *calobj
    
    * E-D-S currently segfaults in e_util_utf8_make_valid(),
      which gets a NULL string pointer and unconditionally
      calls strlen() on it, if cal_backend_get_object() does
      not modify its *calobj argument (i.e., leaves it NULL)
    * we workaround the issue by returning an empty string
      as *calobj if we cannot read the requested calobj from
      our internal engine
    * this is the case e.g. when opening a new calendar entry
      (the UID we get does not yet exist, so our engine
      returns a NULL object plus an error)

 src/calendar/e-cal-backend-kolab.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index dfc43af..92fe513 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -545,12 +545,16 @@ cal_backend_kolab_get_object (ECalBackendSync *backend,
        if (tmp_err != NULL) {
                kolab_util_calendar_err_to_edb_err (error, tmp_err, __func__, __LINE__);
                g_error_free (tmp_err);
+               /* workaround e_util_utf8_make_valid() segfaulting on NULL argument */
+               *calobj = g_strdup ("");
                return;
        }
        if (ecalcomp != NULL) {
                *calobj = (gchar *) e_cal_component_get_as_string (ecalcomp);
                g_object_unref (ecalcomp);
-       }
+       } else
+               /* workaround e_util_utf8_make_valid() segfaulting on NULL argument */
+               *calobj = g_strdup ("");
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]