From bc59205b829d7074df8ded16c2835e5c8feeb547 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 26 Mar 2015 01:45:35 -0300 Subject: [PATCH] source-dialog: take uri validation into account --- src/gcal-source-dialog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c index c9818025..7aac5f9b 100644 --- a/src/gcal-source-dialog.c +++ b/src/gcal-source-dialog.c @@ -479,6 +479,7 @@ validate_url_cb (GcalSourceDialog *dialog) ESourceWebdav *webdav; ESource *source; gchar *host, *path; + gboolean uri_valid; priv->validate_url_resource_id = 0; host = path = NULL; @@ -491,11 +492,11 @@ validate_url_cb (GcalSourceDialog *dialog) g_clear_pointer (&(priv->remote_source), g_object_unref); // Get the hostname and file path from the server - uri_get_fields (gtk_entry_get_text (GTK_ENTRY (priv->calendar_address_entry)), NULL, &host, &path); + uri_valid = uri_get_fields (gtk_entry_get_text (GTK_ENTRY (priv->calendar_address_entry)), NULL, &host, &path); g_debug ("[source-dialog] host: '%s', path: '%s'", host, path); - if (path == NULL || host == NULL) + if (host == NULL || !uri_valid) goto out; /**