summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2016-12-01 14:55:58 +0100
committerOndrej Holy <oholy@redhat.com>2016-12-12 14:40:51 +0100
commit2b234a0f62a858de19231c2c69fb6c1531ff4f3c (patch)
tree69b19ff4f8132a9c88c3f21928ff013fcae10a38
parent63b45093ccbdba33586db740ff4f5da6506caff6 (diff)
downloadgvfs-2b234a0f62a858de19231c2c69fb6c1531ff4f3c.tar.gz
dnssd: Return error instead of abort
gvfsd-dnssd aborts currently if invalid encoded triple is provided and g_vfs_dns_sd_resolver_resolve is called. Return error instead of abort. https://bugzilla.gnome.org/show_bug.cgi?id=772849
-rw-r--r--common/gvfsdnssdresolver.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/gvfsdnssdresolver.c b/common/gvfsdnssdresolver.c
index 853f8b0b..049cf7aa 100644
--- a/common/gvfsdnssdresolver.c
+++ b/common/gvfsdnssdresolver.c
@@ -1158,6 +1158,14 @@ g_vfs_dns_sd_resolver_resolve (GVfsDnsSdResolver *resolver,
task = g_task_new (resolver, cancellable, callback, user_data);
g_task_set_source_tag (task, g_vfs_dns_sd_resolver_resolve);
+ if (resolver->service_type == NULL)
+ {
+ g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Error initializing Avahi resolver"));
+ g_object_unref (task);
+ goto out;
+ }
+
if (resolver->is_resolved)
{
g_task_return_boolean (task, TRUE);