aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/pcs/cal-backend-file.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 30bc41613c..c724d7f35d 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-24 Rodrigo Moya <rodrigo@ximian.com>
+
+ * pcs/cal-backend-file.c (save): check the value returned by
+ gnome_vfs_uri_to_string before using it.
+ (cal_backend_file_open): ditto.
+
2002-05-20 Ettore Perazzoli <ettore@ximian.com>
* gui/dialogs/event-editor.c (event_editor_init): Pass the
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index 599c09b465..ad15d0433c 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -284,6 +284,8 @@ save (CalBackendFile *cbfile)
g_assert (priv->icalcomp != NULL);
uri = gnome_vfs_uri_new (priv->uri);
+ if (!uri)
+ goto error;
/* Make a backup copy of the file if it exists */
tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
@@ -883,7 +885,8 @@ cal_backend_file_open (CalBackend *backend, const char *uristr, gboolean only_if
| GNOME_VFS_URI_HIDE_HOST_NAME
| GNOME_VFS_URI_HIDE_HOST_PORT
| GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD));
- if (!str_uri) {
+ if (!str_uri || !strlen (str_uri)) {
+ g_free (str_uri);
gnome_vfs_uri_unref (uri);
return CAL_BACKEND_OPEN_ERROR;
}