dbus_g_proxy_new_for_peer, on a bus (dbus-daemon), ought to talk to the dbus-daemon itself (admittedly it's not amazingly useful to do so, since most of the bus daemon's methods require the destination "org.freedesktop.DBus" to be specified). It certainly shouldn't crash dbus-glib, which I discovered it did when I tried using it in an unrelated regression test. Patch to follow.
Created attachment 51526 [details] [review] Fix two crashes when dbus_g_proxy_new_for_peer is used on a bus The first part of the bug is that when NameOwnerChanged is received with a dbus_g_proxy_new_for_peer (which has no name) alive, checking whether it was affected by the NameOwnerChanged caused a NULL dereference and segfault. The second part of the bug is that if the last proxy in existence is for a peer, when it was unregistered there would be no owner_match_rules, causing a crash. Both are exercised in the new test added here.
Created attachment 51527 [details] [review] Add a utility function to tear down a private connection in tests The test added in Attachment #51526 [details] needs this, too.
Created attachment 60057 [details] [review] [1/2] Add a utility function to tear down a private connection in tests --- Rebased onto the branch from Bug #40151, since that branch is required in order to make tests pass again.
Created attachment 60058 [details] [review] [2/2] Fix two crashes when dbus_g_proxy_new_for_peer is used on a bus The first part of the bug is that when NameOwnerChanged is received with a dbus_g_proxy_new_for_peer (which has no name) alive, checking whether it was affected by the NameOwnerChanged caused a NULL dereference and segfault. The second part of the bug is that if the last proxy in existence is for a peer, when it was unregistered there would be no owner_match_rules, causing a crash. Both are exercised in the new test added here. --- Also rebased onto Bug #40151.
Comment on attachment 60057 [details] [review] [1/2] Add a utility function to tear down a private connection in tests Review of attachment 60057 [details] [review]: ----------------------------------------------------------------- Looks good.
Comment on attachment 60058 [details] [review] [2/2] Fix two crashes when dbus_g_proxy_new_for_peer is used on a bus Review of attachment 60058 [details] [review]: ----------------------------------------------------------------- Great, ship it.
Thanks, fixed in git for 0.100
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.