]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: Fix a read after free error in bus-match. (#3624) (#3625)
authorWeng Xuetian <wengxt@gmail.com>
Wed, 29 Jun 2016 20:22:12 +0000 (13:22 -0700)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2016 20:22:12 +0000 (22:22 +0200)
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.

src/libsystemd/sd-bus/bus-match.c

index 397baf6f33cd722e98f27e15e836458f9d999d28..db01f211355efedf6956f8bedfeaab0281c672e9 100644 (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;
                 }
         }