Bug 55776 - Crash when server_init_sync() fails in polkit-agent
Summary: Crash when server_init_sync() fails in polkit-agent
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-08 19:14 UTC by Adam Jackson
Modified: 2012-10-09 18:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Adam Jackson 2012-10-08 19:14:46 UTC
First, a fix:

===
diff -up polkit-0.107/src/polkitagent/polkitagentlistener.c.jx polkit-0.107/src/polkitagent/polkitagentlistener.c
--- polkit-0.107/src/polkitagent/polkitagentlistener.c.jx	2012-04-24 12:05:34.000000000 -0400
+++ polkit-0.107/src/polkitagent/polkitagentlistener.c	2012-10-08 13:17:27.884850539 -0400
@@ -260,10 +260,9 @@ server_new (PolkitSubject  *subject,
   if (!server_init_sync (server, cancellable, error))
     {
       server_free (server);
-      goto out;
+      return NULL;
     }
 
- out:
   return server;
 }
 
===

Note that otherwise we return a freed server object.  Since later in polkit_agent_listener_register_with_options we check against NULL to determine failure, this makes for sad times later when we call server_free() on it again.
Comment 1 David Zeuthen (not reading bugmail) 2012-10-09 18:11:04 UTC
Committed to master, thanks

http://cgit.freedesktop.org/polkit/commit/?id=59f2d96ce3ac63173669f299a9453a7bf5e70a70


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.