summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2017-04-10 13:45:27 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2017-04-12 15:04:58 +0200
commit35186217d44d0138a1aedf7a4db72249b2c40e66 (patch)
treea3f01079753f69a9f39063c317b0d12688eaf711
parent1193f20a8267e506d863b27c74870c86c085902b (diff)
downloadsssd-35186217d44d0138a1aedf7a4db72249b2c40e66.tar.gz
sssd-35186217d44d0138a1aedf7a4db72249b2c40e66.tar.xz
sssd-35186217d44d0138a1aedf7a4db72249b2c40e66.zip
sbus: check connection for NULL before unregister it
There seem to be code paths where the data is a added to the hash before the connection is properly initialized, to avoid core dump during shut down we only call dbus_conection_unregister_object_path() if there is a connection. Resolves: https://pagure.io/SSSD/sssd/issue/3367 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--src/sbus/sssd_dbus_interface.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sbus/sssd_dbus_interface.c b/src/sbus/sssd_dbus_interface.c
index 1a11c6abc..c9007a481 100644
--- a/src/sbus/sssd_dbus_interface.c
+++ b/src/sbus/sssd_dbus_interface.c
@@ -490,7 +490,13 @@ sbus_opath_hash_delete_cb(hash_entry_t *item,
conn = talloc_get_type(pvt, struct sbus_connection);
path = sbus_opath_get_base_path(NULL, item->key.str);
- dbus_connection_unregister_object_path(conn->dbus.conn, path);
+ /* There seem to be code paths where the data is added to the hash
+ * before the connection is properly initialized, to avoid core dump
+ * during shut down we only call dbus_connection_unregister_object_path()
+ * if there is a connection. */
+ if (conn->dbus.conn != NULL) {
+ dbus_connection_unregister_object_path(conn->dbus.conn, path);
+ }
}
hash_table_t *