From 6622fd4d79c593a785048fea52d1667b974526f0 Mon Sep 17 00:00:00 2001 From: Karunakaran A <48997923+karuna2git@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:06:58 -0500 Subject: [PATCH] RDKEMW-229 : Check the empty interface & ipversion input (#30) Reason for change: Check the empty interface & ipversion input Test Procedure: Call org.rdk.NetworkManager.GetIPSettings with no input param Risks: Medium Signed-off-by: Karunakaran A --- NetworkManagerJsonRpc.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NetworkManagerJsonRpc.cpp b/NetworkManagerJsonRpc.cpp index 1963a70..9b0a8ed 100644 --- a/NetworkManagerJsonRpc.cpp +++ b/NetworkManagerJsonRpc.cpp @@ -290,8 +290,14 @@ namespace WPEFramework uint32_t rc = Core::ERROR_GENERAL; Exchange::INetworkManager::IPAddress address{}; - string interface = parameters["interface"].String(); - string ipversion = parameters["ipversion"].String(); + string interface{}; + string ipversion{}; + + if (parameters.HasLabel("interface")) + interface = parameters["interface"].String(); + + if (parameters.HasLabel("ipversion")) + ipversion = parameters["ipversion"].String(); if (_networkManager) rc = _networkManager->GetIPSettings(interface, ipversion, address);