summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-04-12 08:21:38 +0300
committerEd Tanous <ed@tanous.net>2024-04-13 18:28:14 +0300
commit8e8245db1812bb0ec294a1c9a97c3a65558840ed (patch)
tree3c0d049cd5eddb5ff8e7364129dab0aac1278678 /redfish-core
parent6f056f246d9bcfd611102ee712d4a2935504b448 (diff)
downloadbmcweb-8e8245db1812bb0ec294a1c9a97c3a65558840ed.tar.xz
Fix nullptr failures for image upload
Several places that call *req.ioService were missing nullptr checks. Add them, and fix the one case where it might not be filled in. Tested: With HTTP2 enabled, the following command succeeds. ``` curl -k https://192.168.7.2/redfish/v1/UpdateService/update -F 'UpdateParameters={"Targets":["/redfish/v1/Managers/bmc"]} ;type=application/json' --user "root:0penBmc" -F UpdateFile=@/home/ed/bmcweb/16mb.txt -v -H "Expect:" ``` Change-Id: I81e7944c22f5922d461bf5d231086c7468a16e62 Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/lib/certificate_service.hpp6
-rw-r--r--redfish-core/lib/update_service.hpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 5dc4413821..6fba827371 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -766,6 +766,12 @@ inline void
return;
}
+ if (req.ioService == nullptr)
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
// Make this static so it survives outside this method
static boost::asio::steady_timer timeout(*req.ioService);
timeout.expires_after(std::chrono::seconds(timeOut));
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index 9ef8311984..8617071e45 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -405,6 +405,12 @@ static void monitorForSoftwareAvailable(
return;
}
+ if (req.ioService == nullptr)
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
fwAvailableTimer =
std::make_unique<boost::asio::steady_timer>(*req.ioService);