summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/lib/log_services.hpp6
-rw-r--r--redfish-core/lib/pcie.hpp11
2 files changed, 13 insertions, 4 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index f27785d78f..7522c0349a 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -3957,7 +3957,11 @@ static bool fillPostCodeEntry(
// Get the Message from the MessageRegistry
const registries::Message* message =
registries::getMessage("OpenBMC.0.2.BIOSPOSTCode");
-
+ if (message == nullptr)
+ {
+ BMCWEB_LOG_ERROR("Couldn't find known message?");
+ return false;
+ }
uint64_t currentCodeIndex = 0;
uint64_t firstCodeTimeUs = 0;
for (const std::pair<uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>&
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 9392916c47..223522b5f0 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -712,7 +712,11 @@ inline void addPCIeFunctionProperties(
{
const std::string* strProperty =
std::get_if<std::string>(&property.second);
-
+ if (strProperty == nullptr)
+ {
+ BMCWEB_LOG_ERROR("Function wasn't a string?");
+ continue;
+ }
if (property.first == functionName + "DeviceId")
{
resp.jsonValue["DeviceId"] = *strProperty;
@@ -799,11 +803,12 @@ inline void
systemName);
return;
}
+ std::string_view pcieFunctionIdView = pcieFunctionIdStr;
uint64_t pcieFunctionId = 0;
std::from_chars_result result = std::from_chars(
- &*pcieFunctionIdStr.begin(), &*pcieFunctionIdStr.end(), pcieFunctionId);
- if (result.ec != std::errc{} || result.ptr != &*pcieFunctionIdStr.end())
+ pcieFunctionIdView.begin(), pcieFunctionIdView.end(), pcieFunctionId);
+ if (result.ec != std::errc{} || result.ptr != pcieFunctionIdView.end())
{
messages::resourceNotFound(asyncResp->res, "PCIeFunction",
pcieFunctionIdStr);