chiark / gitweb /
bus: always explicitly rewind read index before passing message to caller or callback
[elogind.git] / src / libsystemd-bus / bus-match.c
index 01434b33b5285d64f0cd18399d6c098b952114c2..501a38df70b8aad2905d687fffc5bf070e348624 100644 (file)
@@ -251,6 +251,10 @@ int bus_match_run(
                         node->leaf.last_iteration = bus->iteration_counter;
                 }
 
+                r = sd_bus_message_rewind(m, true);
+                if (r < 0)
+                        return r;
+
                 /* Run the callback. And then invoke siblings. */
                 assert(node->leaf.callback);
                 r = node->leaf.callback(bus, ret, m, node->leaf.userdata);