diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-07-03 08:06:08 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-07-07 05:19:18 +0300 |
commit | 16a5535f15af187b56d4c927aa9dec3ef8f66af4 (patch) | |
tree | 99004c2d241048f2d4bd18aacf40e84c64f8a34c /include/google | |
parent | 623e533645957d5a1ecdcfb303dc7a5f4d16900f (diff) | |
download | bmcweb-16a5535f15af187b56d4c927aa9dec3ef8f66af4.tar.xz |
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
Diffstat (limited to 'include/google')
-rw-r--r-- | include/google/google_service_root.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp index b43a8a5ab9..c59cbab40e 100644 --- a/include/google/google_service_root.hpp +++ b/include/google/google_service_root.hpp @@ -50,7 +50,7 @@ struct ResolvedEntity std::string id; std::string service; std::string object; - const char* interface; + std::string interface; }; using ResolvedEntityHandler = std::function<void( |