Skip to content

Commit

Permalink
sbus: check connection for NULL before unregister it
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sumit-bose committed Apr 11, 2017
1 parent 955574e commit 2cb9eb0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sbus/sssd_dbus_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 a 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 *
Expand Down

0 comments on commit 2cb9eb0

Please sign in to comment.