Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions rfcMgr/rfc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "rfc_common.h"
#include "rfc_mgr_iarm.h"
#include "rfc_xconf_handler.h"
#if defined(RDK_LOGGER)
#include "rdk_logger.h"
#endif
#include <fstream>
#include <unistd.h>
#include <sys/types.h>
Expand All @@ -39,9 +42,21 @@ namespace rfc {
}
#endif
RFCManager ::RFCManager() {
#if defined(RDK_LOGGER)
/* Initialize RDK Logger */
rdk_logger_init(0 == access(OVERIDE_DEBUG_INI_FILE, R_OK) ? OVERIDE_DEBUG_INI_FILE : DEBUG_INI_FILE);

static char RFCMGRLOG[] = "LOG.RDK.RFCMGR";
rdk_logger_ext_config_t config = {
.pModuleName = RFCMGRLOG, /* Module name */
.loglevel = RDK_LOG_INFO, /* Default log level */
.output = RDKLOG_OUTPUT_CONSOLE, /* Output to console (stdout/stderr) */
.format = RDKLOG_FORMAT_WITH_TS, /* Timestamped format */
.pFilePolicy = NULL /* Not using file output, so NULL */
};

if (rdk_logger_ext_init(&config) != RDK_SUCCESS) {
printf("RFC : ERROR - Extended logger init failed\n");
}
#endif
/* Initialize IARM Bus */
InitializeIARM();
}
Expand Down
4 changes: 4 additions & 0 deletions rfcMgr/rfc_xconf_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2413,11 +2413,13 @@ void RuntimeFeatureControlProcessor::processXconfResponseConfigDataPart(JSON *fe
}
else
{
#if !defined(RDKB_SUPPORT)
if (newValue.empty())
{
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] EMPTY value for %s is rejected\n", __FUNCTION__, __LINE__, newKey.c_str());
continue;
}
#endif
Comment on lines +2416 to +2422
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty-value rejection is now compiled out for RDKB_SUPPORT, but RDKB’s set_RFCProperty() converts non-string types using std::stoi/stoul/stof/etc without any exception handling. If XConf sends an empty string for a numeric/bool parameter, this will throw and can terminate the process. Consider keeping the empty-value guard for RDKB too (at least for non-string params) or adding safe parsing/try-catch with a logged failure + skip update.

Suggested change
#if !defined(RDKB_SUPPORT)
if (newValue.empty())
{
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] EMPTY value for %s is rejected\n", __FUNCTION__, __LINE__, newKey.c_str());
continue;
}
#endif
if (newValue.empty())
{
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] EMPTY value for %s is rejected\n", __FUNCTION__, __LINE__, newKey.c_str());
continue;
}

Copilot uses AI. Check for mistakes.

if(newKey == BOOTSTRAP_XCONF_URL_KEY_STR)
{
Expand Down Expand Up @@ -2555,6 +2557,7 @@ bool RuntimeFeatureControlProcessor::isConfigValueChange(std ::string name, std
}
else
{
#if !defined(RDKB_SUPPORT)
std::string account_key_str = RFC_ACCOUNT_ID_KEY_STR;
std::string unknown_str = "Unknown";
bool isAccountKey = (key.find(account_key_str) != std::string::npos) ? true : false;
Expand All @@ -2576,6 +2579,7 @@ bool RuntimeFeatureControlProcessor::isConfigValueChange(std ::string name, std
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] AccountId is Valid %s, Updating the device Database\n", __FUNCTION__, __LINE__,value.c_str());
}
}
#endif

return true;
}
Expand Down