From 179927c70bd9d1dab99acfcb4f4a22112facedf1 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Fri, 24 May 2002 18:36:12 +0000 Subject: check the value returned by gnome_vfs_uri_to_string before using it. 2002-05-24 Rodrigo Moya * pcs/cal-backend-file.c (save): check the value returned by gnome_vfs_uri_to_string before using it. (cal_backend_file_open): ditto. svn path=/trunk/; revision=17008 --- calendar/ChangeLog | 6 ++++++ calendar/pcs/cal-backend-file.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 + + * 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 * 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; } -- cgit