From 8b9307adee075d41f9fd0d8c22addc5a4a2ddb0e Mon Sep 17 00:00:00 2001 From: Aashray Boddu Date: Fri, 24 Oct 2025 00:10:13 -0500 Subject: [PATCH 1/2] rde: re-format for clang-19 re-format code for clang-19. Signed-off-by: Aashray Boddu --- redfish-core/lib/rde.hpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/redfish-core/lib/rde.hpp b/redfish-core/lib/rde.hpp index 2db9c69173..c7ceea96ae 100644 --- a/redfish-core/lib/rde.hpp +++ b/redfish-core/lib/rde.hpp @@ -1232,12 +1232,13 @@ inline void requestRoutesRDEService(crow::App& app) const std::shared_ptr& asyncResp, const std::string& systemId, const std::string& deviceId, const std::string& vendorPath) { - std::string baseUri = "/redfish/v1/Systems/" + systemId + - "/NetworkAdapters/" + deviceId; + std::string baseUri = "/redfish/v1/Systems/" + systemId + + "/NetworkAdapters/" + deviceId; - handleRDEServicePath(app, req, asyncResp, systemId, deviceId, - vendorPath, redfish::networkSchemaName, baseUri); - }); + handleRDEServicePath(app, req, asyncResp, systemId, deviceId, + vendorPath, redfish::networkSchemaName, + baseUri); + }); BMCWEB_ROUTE(app, "/redfish/v1/Systems//NetworkAdapters/") .privileges(redfish::privileges::getProcessor) @@ -1245,11 +1246,11 @@ inline void requestRoutesRDEService(crow::App& app) [&app](const crow::Request& req, const std::shared_ptr& asyncResp, const std::string& systemId, const std::string& deviceId) { - std::string baseUri = "/redfish/v1/Systems/" + systemId + - "/NetworkAdapters/" + deviceId; - handleRDEServiceRoot(app, req, asyncResp, systemId, deviceId, - redfish::networkSchemaName, baseUri); - }); + std::string baseUri = "/redfish/v1/Systems/" + systemId + + "/NetworkAdapters/" + deviceId; + handleRDEServiceRoot(app, req, asyncResp, systemId, deviceId, + redfish::networkSchemaName, baseUri); + }); } } // namespace redfish From a6c21df2c609458d7f31bfa5eeb129e9e13abfb8 Mon Sep 17 00:00:00 2001 From: Aashray Boddu Date: Fri, 24 Oct 2025 00:16:50 -0500 Subject: [PATCH 2/2] rde: Add error handling for empty json payload Add error handling for empty payload. This change prevents parsing empty json payload avaoiding crashdump. Signed-off-by: Aashray Boddu --- redfish-core/lib/rde.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/redfish-core/lib/rde.hpp b/redfish-core/lib/rde.hpp index c7ceea96ae..c8e467a93a 100644 --- a/redfish-core/lib/rde.hpp +++ b/redfish-core/lib/rde.hpp @@ -171,7 +171,14 @@ inline nlohmann::json handleDeferredBindings(const std::string& bejJsonInput, bejJson = std::regex_replace(bejJson, std::regex(R"(%I(\d+))"), "$1"); BMCWEB_LOG_DEBUG("RDE: BEJ JSON String Output: {}", bejJson); - return nlohmann::json::parse(bejJson); + nlohmann::json jsonPayload; + if(!bejJson.empty()) + { + jsonPayload = nlohmann::json::parse(bejJson); + return jsonPayload; + } + else + return jsonPayload; } /** * @brief Process the TaskUpdated signal for an RDE Operation Task.