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

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
(cherry picked from commit 3518621)
(cherry picked from commit 72da800)
  • Loading branch information
sumit-bose authored and Lukas Slebodnik committed Apr 12, 2017
1 parent 963acdf commit a5afe47
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 @@ -489,7 +489,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);
}
}

errno_t
Expand Down

0 comments on commit a5afe47

Please sign in to comment.