Fix logger use after free
Nodes() points to invalid nodes every time you call RemapLoggedChannel.
Use the logged configuration instead, which is not being destroyed.
Change-Id: Id8f0efc6ac3611fa70a812bb396ef3151919ced2
diff --git a/aos/events/logging/logger.cc b/aos/events/logging/logger.cc
index 19a0229..33d2abb 100644
--- a/aos/events/logging/logger.cc
+++ b/aos/events/logging/logger.cc
@@ -876,7 +876,7 @@
// Remap all existing remote timestamp channels. They will be recreated, and
// the data logged isn't relevant anymore.
- for (const Node *node : Nodes()) {
+ for (const Node *node : configuration::GetNodes(logged_configuration())) {
std::vector<const Node *> timestamp_logger_nodes =
configuration::TimestampNodes(logged_configuration(), node);
for (const Node *remote_node : timestamp_logger_nodes) {