util: use constexpr string instead of string objects
This handles an initialization order issue found with address
santization testing.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I7b3b6e980e378855e8bda8209dba18c20b67a000
diff --git a/bmc/firmware_handler.cpp b/bmc/firmware_handler.cpp
index ccd76d3..d71cc9f 100644
--- a/bmc/firmware_handler.cpp
+++ b/bmc/firmware_handler.cpp
@@ -464,18 +464,18 @@
}
Session* curr;
- const std::string* active;
+ const char* active;
if (path == hashBlobId)
{
/* 2c) are they opening the /flash/hash ? (to start the process) */
curr = &activeHash;
- active = &activeHashBlobId;
+ active = activeHashBlobId;
}
else
{
curr = &activeImage;
- active = &activeImageBlobId;
+ active = activeImageBlobId;
}
curr->flags = flags;
@@ -484,7 +484,7 @@
lookup[session] = curr;
- addBlobId(*active);
+ addBlobId(active);
removeBlobId(verifyBlobId);
changeState(UpdateState::uploadInProgress);