From 8e8245db1812bb0ec294a1c9a97c3a65558840ed Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 11 Apr 2024 22:21:38 -0700 Subject: 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 --- include/image_upload.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/image_upload.hpp b/include/image_upload.hpp index ef615cb3b8..8b3dc107c9 100644 --- a/include/image_upload.hpp +++ b/include/image_upload.hpp @@ -31,6 +31,12 @@ inline void asyncResp->res.result(boost::beast::http::status::service_unavailable); return; } + if (req.ioService == nullptr) + { + asyncResp->res.result( + boost::beast::http::status::internal_server_error); + return; + } // Make this const static so it survives outside this method static boost::asio::steady_timer timeout(*req.ioService, std::chrono::seconds(5)); -- cgit v1.2.3