[glib-networking] glibpacrunner: fix crash on error



commit 18a5df8e9869941dd520ad3a0ad405b38928ec81
Author: Dan Winship <danw gnome org>
Date:   Sun Sep 29 12:39:33 2013 -0400

    glibpacrunner: fix crash on error
    
    glibpacrunner was asserting that g_proxy_resolver_lookup() didn't
    return an error (since libproxy 0.3 always returned a non-error
    response no matter what happened). But libproxy 0.4 does error out and
    return NULL in some rare cases, so we need to allow for that.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=866927

 proxy/libproxy/glibpacrunner.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/proxy/libproxy/glibpacrunner.c b/proxy/libproxy/glibpacrunner.c
index 0e2cda5..87a1a32 100644
--- a/proxy/libproxy/glibpacrunner.c
+++ b/proxy/libproxy/glibpacrunner.c
@@ -48,11 +48,14 @@ got_proxies (GObject      *source,
   GError *error = NULL;
 
   proxies = g_proxy_resolver_lookup_finish (resolver, result, &error);
-  g_assert (!error);
-
-  g_dbus_method_invocation_return_value (invocation,
-                                        g_variant_new ("(^as)", proxies));
-  g_strfreev (proxies);
+  if (error)
+    g_dbus_method_invocation_take_error (invocation);
+  else
+    {
+      g_dbus_method_invocation_return_value (invocation,
+                                            g_variant_new ("(^as)", proxies));
+      g_strfreev (proxies);
+    }
 }
 
 static void


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