sd-bus: Fix a read after free error in bus-match. (#3624) (#3625)

The loop on bus_match_run should break and return immediately if
bus->match_callbacks_modified is true. Otherwise the loop may access
free'd data.
This commit is contained in:
Weng Xuetian
2016-06-29 22:22:12 +02:00
committed by Lennart Poettering
parent d6568222d7
commit f0d5c5be59
+3
View File
@@ -429,6 +429,9 @@ int bus_match_run(
r = bus_match_run(bus, c, m);
if (r != 0)
return r;
if (bus && bus->match_callbacks_modified)
return 0;
}
}