Google RoT: avoid potential dangling pointer
The struct |ResolvedEntity| stores a pointer which might be dangling in
the future when interface is not longer a string literal. Given that the
interface string is small enough, this commits changes the data member
to a string which is constructed (copied) from the string literal today.
Tested: trivial change. Compiles.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I2759635f7fa296cc8aa141735efb3799a1503726
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp
index b43a8a5..c59cbab 100644
--- a/include/google/google_service_root.hpp
+++ b/include/google/google_service_root.hpp
@@ -50,7 +50,7 @@
std::string id;
std::string service;
std::string object;
- const char* interface;
+ std::string interface;
};
using ResolvedEntityHandler = std::function<void(