[gvfs] dnssd: Return error instead of abort



commit 2b234a0f62a858de19231c2c69fb6c1531ff4f3c
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Dec 1 14:55:58 2016 +0100

    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

 common/gvfsdnssdresolver.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/common/gvfsdnssdresolver.c b/common/gvfsdnssdresolver.c
index 853f8b0..049cf7a 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]