diff options
author | JP Rosevear <jpr@ximian.com> | 2004-03-31 14:45:32 +0000 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-03-31 14:45:32 +0000 |
commit | c54935313ef7a242ba094208f2f39230c77f61d1 (patch) | |
tree | 0855700197bcf56ab82ee7be240618ea1325d80c | |
parent | 8c8da1805df0a6774c53a686fde6df289218186b (diff) | |
download | evolution-data-server-c54935313ef7a242ba094208f2f39230c77f61d1.tar.gz |
Fixes #54713
2004-03-31 JP Rosevear <jpr@ximian.com>
Fixes #54713
* libecal/e-cal.c (e_cal_get_object): only try to parse the string
if the status is good
(e_cal_get_timezone): ditto
(e_cal_get_default_object): ditto
-rw-r--r-- | calendar/ChangeLog | 9 | ||||
-rw-r--r-- | calendar/libecal/e-cal.c | 30 |
2 files changed, 30 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d81b90e24..5cb4b30ac 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-03-31 JP Rosevear <jpr@ximian.com> + + Fixes #54713 + + * libecal/e-cal.c (e_cal_get_object): only try to parse the string + if the status is good + (e_cal_get_timezone): ditto + (e_cal_get_default_object): ditto + 2004-03-29 Rodrigo Moya <rodrigo@ximian.com> * libecal/e-cal.c (e_cal_generate_instances): added support for dealing diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c index 04b706998..a5943f333 100644 --- a/calendar/libecal/e-cal.c +++ b/calendar/libecal/e-cal.c @@ -2299,10 +2299,13 @@ e_cal_get_default_object (ECal *ecal, icalcomponent **icalcomp, GError **error) g_cond_wait (our_op->cond, our_op->mutex); status = our_op->status; - if (status) + if (status) { *icalcomp = NULL; - else + } else { *icalcomp = icalparser_parse_string (our_op->string); + if (!(*icalcomp)) + status = E_CALENDAR_STATUS_INVALID_OBJECT; + } g_free (our_op->string); e_calendar_remove_op (ecal, our_op); @@ -2378,8 +2381,13 @@ e_cal_get_object (ECal *ecal, const char *uid, const char *rid, icalcomponent ** g_cond_wait (our_op->cond, our_op->mutex); status = our_op->status; - *icalcomp = icalparser_parse_string (our_op->string); - /* FIXME if the parse fails its an error */ + if (status) { + *icalcomp = NULL; + } else { + *icalcomp = icalparser_parse_string (our_op->string); + if (!(*icalcomp)) + status = E_CALENDAR_STATUS_INVALID_OBJECT; + } g_free (our_op->string); e_calendar_remove_op (ecal, our_op); @@ -3711,18 +3719,22 @@ e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError ** successful response will notity us via our cv */ g_cond_wait (our_op->cond, our_op->mutex); - status = our_op->status; - - icalcomp = icalparser_parse_string (our_op->string); + status = our_op->status; + if (status) { + icalcomp = NULL; + } else { + icalcomp = icalparser_parse_string (our_op->string); + if (!icalcomp) + status = E_CALENDAR_STATUS_INVALID_OBJECT; + } g_free (our_op->string); - /* FIXME Invalid object status? */ if (!icalcomp) { e_calendar_remove_op (ecal, our_op); g_mutex_unlock (our_op->mutex); e_calendar_free_op (our_op); - E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OBJECT_NOT_FOUND, error); + E_CALENDAR_CHECK_STATUS (status, error); } *zone = icaltimezone_new (); |