diff options
author | Ed Tanous <ed@tanous.net> | 2024-07-11 08:10:14 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-07-11 19:58:11 +0300 |
commit | ac1e1246464e28fe4313ba936a6b8f64ec65bb12 (patch) | |
tree | 8a03e3e0f270936cf1792081af3dff377a6c65b2 /redfish-core/lib | |
parent | 29aab242f2d35891bd808e057e33b328989836d3 (diff) | |
download | bmcweb-master.tar.xz |
This is an instance of common error #5. Fix it.
Tested: Code compiles. Inspection only.
Change-Id: I5580a9789930ffab6513a03689b633d5201e72a4
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'redfish-core/lib')
-rw-r--r-- | redfish-core/lib/update_service.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index 9a399affa4..683a8cb847 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -810,8 +810,12 @@ inline std::optional<MultiPartUpdateParameters> if (param.second == "UpdateParameters") { std::vector<std::string> tempTargets; - nlohmann::json content = - nlohmann::json::parse(formpart.content); + nlohmann::json content = nlohmann::json::parse(formpart.content, + nullptr, false); + if (content.is_discarded()) + { + return std::nullopt; + } nlohmann::json::object_t* obj = content.get_ptr<nlohmann::json::object_t*>(); if (obj == nullptr) |