1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-25 13:49:55 +03:00

home: fix heap-use-after-free

`bus_home_emit_remove()` may be called from manager_free() -> home_free().
In that case, manager->bus is already unref()ed.

Fixes #21767.
This commit is contained in:
Yu Watanabe
2021-12-14 15:38:12 +09:00
parent 76fc157702
commit 2ff457720b

View File

@ -940,6 +940,12 @@ int bus_home_emit_remove(Home *h) {
if (!h->announced)
return 0;
if (!h->manager)
return 0;
if (!h->manager->bus)
return 0;
r = bus_home_path(h, &path);
if (r < 0)
return r;