diff --git a/AVOutput/AVOutputTV.cpp b/AVOutput/AVOutputTV.cpp index 9dec3bc134..94f38fe663 100644 --- a/AVOutput/AVOutputTV.cpp +++ b/AVOutput/AVOutputTV.cpp @@ -375,13 +375,6 @@ namespace Plugin { } else { LOGINFO("Platform Init successful...\n"); - ret = TvSyncCalibrationInfoODM(); - if(ret != tvERROR_NONE) { - LOGERR(" SD3 <->cri_data sync failed, ret: %s \n", getErrorString(ret).c_str()); - } - else { - LOGERR(" SD3 <->cri_data sync success, ret: %s \n", getErrorString(ret).c_str()); - } } tvVideoFormatCallbackData callbackData = {this,tvVideoFormatChangeHandler}; @@ -2282,9 +2275,14 @@ namespace Plugin { { LOGINFO("Entry\n"); - pic_modes_t *dvModes; + tvDolbyMode_t dvModes[tvMode_Max]; + tvDolbyMode_t *dvModesPtr = dvModes; // Pointer to statically allocated tvDolbyMode_t array unsigned short totalAvailable = 0; - tvError_t ret = GetTVSupportedDolbyVisionModesODM(&dvModes,&totalAvailable); + + // Set an initial value to indicate the mode type + dvModes[0] = tvDolbyMode_Dark; + + tvError_t ret = GetTVSupportedDolbyVisionModes(&dvModesPtr, &totalAvailable); if(ret != tvERROR_NONE) { returnResponse(false); } @@ -2292,7 +2290,7 @@ namespace Plugin { JsonArray SupportedDVModes; for(int count = 0;count +#include +#include #include "tvTypes.h" #include "tvSettings.h" @@ -67,6 +69,49 @@ #define STRING_DEFAULT "Default" #define STRING_SOURCE "Source." #define CREATE_DIRTY(__X__) (__X__+=STRING_DIRTY) +#define CAPABLITY_FILE_NAME "pq_capabilities.ini" + + +class CIniFile +{ + std::string m_path; + std::string opt_path; + boost::property_tree::ptree m_data; + +public: + CIniFile(const std::string & filename, const std::string & filepath = "/etc/" ) + { + opt_path = "/opt/panel/"; + m_path = filepath; + m_path.append(filename); + opt_path.append(filename); + + if(!boost::filesystem::exists( opt_path)) { + std::cout << "AVOutput : Using " << m_path < + T Get(const std::string & key) + { + return m_data.get(key); + } + + template + void Set(const std::string & key, const T & value){ + //TODO DD: Not required currently + //m_data.put(key, value); + } +}; namespace WPEFramework { namespace Plugin { @@ -217,10 +262,14 @@ class AVOutputTV : public AVOutputBase { tvError_t getParamsCaps(std::vector &range, std::vector &pqmode, std::vector &source, std::vector &format,std::string param , std::string & isPlatformSupport, std::vector & index); + int GetPanelID(char *panelid); + int ConvertHDRFormatToContentFormat(tvhdr_type_t hdrFormat); + int ReadCapablitiesFromConf(std::string &rangeInfo,std::string &pqmodeInfo,std::string &formatInfo,std::string &sourceInfo,std::string param, std::string & isPlatformSupport, std::string & indexInfo); void getDimmingModeStringFromEnum(int value, std::string &toStore); void getColorTempStringFromEnum(int value, std::string &toStore); int getCurrentPictureMode(char *picMode); int getDolbyParamToSync(int sourceIndex, int formatIndex, int& value); + tvDolbyMode_t GetDolbyVisionEnumFromModeString(const char* modeString); std::string getDolbyModeStringFromEnum( tvDolbyMode_t mode); JsonArray getSupportedVideoSource(void); int getAvailableCapabilityModesWrapper(std::string param, std::string & outparam); diff --git a/AVOutput/AVOutputTVHelper.cpp b/AVOutput/AVOutputTVHelper.cpp index 75e0641fb6..9046a1890e 100644 --- a/AVOutput/AVOutputTVHelper.cpp +++ b/AVOutput/AVOutputTVHelper.cpp @@ -192,7 +192,7 @@ namespace Plugin { if( source.compare("none") == 0 || source.compare("Current") == 0 ) { tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP; - GetCurrentSource(¤tSource); + GetCurrentVideoSource(¤tSource); sourceIndex = (int)currentSource; } else { @@ -237,14 +237,18 @@ namespace Plugin { int AVOutputTV::getDolbyModeIndex(const char * dolbyMode) { int mode = 0; - pic_modes_t *dolbyModes ; + tvDolbyMode_t dolbyModes[tvMode_Max]; + tvDolbyMode_t *dolbyModesPtr = dolbyModes; // Pointer to statically allocated tvDolbyMode_t array unsigned short totalAvailable = 0; - tvError_t ret = GetTVSupportedDolbyVisionModesODM(&dolbyModes,&totalAvailable); - if(ret == tvERROR_NONE) { - for(int count = 0;count formatInputSet; std::set sourceInputSet; - if( ReadCapablitiesFromConfODM( rangeCapInfo, pqmodeCapInfo, formatCapInfo, sourceCapInfo,param, isPlatformSupport, indexInfo) ) { + if( ReadCapablitiesFromConf( rangeCapInfo, pqmodeCapInfo, formatCapInfo, sourceCapInfo,param, isPlatformSupport, indexInfo) ) { LOGINFO( "%s: readCapablitiesFromConf Failed !!!\n",__FUNCTION__); return false; } @@ -635,7 +639,7 @@ namespace Plugin { PQFileName = std::string(AVOUTPUT_RFC_CALLERID_OVERRIDE); } else { - int val=GetPanelIDODM(panelId); + int val=GetPanelID(panelId); if(val==0) { LOGINFO("%s : panel id read is : %s\n",__FUNCTION__,panelId); if(strncmp(panelId,AVOUTPUT_CONVERTERBOARD_PANELID,strlen(AVOUTPUT_CONVERTERBOARD_PANELID))!=0) { @@ -655,6 +659,7 @@ namespace Plugin { } } strncpy(rfc_caller_id,PQFileName.c_str(),PQFileName.size()); + rfc_caller_id[sizeof(rfc_caller_id) - 1] = '\0'; LOGINFO("%s : Default tvsettings file : %s\n",__FUNCTION__,rfc_caller_id); } @@ -671,7 +676,7 @@ namespace Plugin { current_format = VIDEO_FORMAT_SDR; } // get current source - GetCurrentSource(¤t_source); + GetCurrentVideoSource(¤t_source); tr181_param_name += std::string(AVOUTPUT_SOURCE_PICTUREMODE_STRING_RFC_PARAM); tr181_param_name += "."+convertSourceIndexToString(current_source)+"."+"Format."+convertVideoFormatToString(current_format)+"."+"PictureModeString"; @@ -748,10 +753,10 @@ namespace Plugin { } else if (source == "Current") { tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP; - tvError_t ret = GetCurrentSource(¤tSource); + tvError_t ret = GetCurrentVideoSource(¤tSource); if(ret != tvERROR_NONE) { - LOGWARN("%s: GetCurrentSource( ) Failed \n",__FUNCTION__); + LOGWARN("%s: GetCurrentVideoSource( ) Failed \n",__FUNCTION__); return -1; } source = convertSourceIndexToString(currentSource); @@ -1280,7 +1285,7 @@ namespace Plugin { sourceIndex = (tvVideoSrcType_t)getSourceIndex(source); } else { - GetCurrentSource(&sourceIndex); + GetCurrentVideoSource(&sourceIndex); } char picMode[PIC_MODE_NAME_MAX]={0}; @@ -1303,7 +1308,7 @@ namespace Plugin { tr181ErrorCode_t err = getLocalParam(rfc_caller_id, rfc_param.c_str(), ¶m); if ( tr181Success != err) { tvError_t retVal = GetDefaultPQParams(pqmodeIndex,(tvVideoSrcType_t)sourceIndex, - (tvVideoFormatType_t)ConvertHDRFormatToContentFormatODM((tvhdr_type_t)format), + (tvVideoFormatType_t)ConvertHDRFormatToContentFormat((tvhdr_type_t)format), PQ_PARAM_DOLBY_MODE,&dolby_mode_value); if( retVal != tvERROR_NONE ) { LOGERR("%s : failed\n",__FUNCTION__); @@ -1333,7 +1338,7 @@ namespace Plugin { std::string indexInfo; std::vector localIndex; - if( ReadCapablitiesFromConfODM( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, platformsupport, indexInfo)) { + if( ReadCapablitiesFromConf( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, platformsupport, indexInfo)) { LOGERR( "%s: ReadCapablitiesFromConf Failed !!!\n",__FUNCTION__); return tvERROR_GENERAL; } @@ -1356,7 +1361,7 @@ namespace Plugin { std::string pqmodeInfo; std::string indexInfo; - if( ReadCapablitiesFromConfODM( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, isPlatformSupport, indexInfo)) { + if( ReadCapablitiesFromConf( rangeInfo, pqmodeInfo, formatInfo ,sourceInfo,param, isPlatformSupport, indexInfo)) { LOGERR( "%s: ReadCapablitiesFromConf Failed !!!\n",__FUNCTION__); return tvERROR_GENERAL; } @@ -1367,6 +1372,119 @@ namespace Plugin { return ret; } + int AVOutputTV::GetPanelID(char *panelId) + { + if (panelId == NULL) { + printf("Invalid buffer provided for panel ID\n"); + return -1; + } + + const char *command = "/usr/bin/panelIDConfig -i"; + FILE *fp; + + // Execute the binary + fp = popen(command, "r"); + if (fp == NULL) { + printf("Failed to execute command: %s\n", command); + return -1; + } + + // Read the panel ID from the binary's output + if (fgets(panelId, 20, fp) != NULL) { + size_t len = strlen(panelId); + if (len > 0 && panelId[len - 1] == '\n') { + panelId[len - 1] = '\0'; + } + } else { + printf("Failed to read panel ID from panelIDConfig binary\n"); + pclose(fp); + return -1; + } + + pclose(fp); + return 0; + } + + int AVOutputTV::ConvertHDRFormatToContentFormat(tvhdr_type_t hdrFormat) + { + int ret=tvContentFormatType_SDR; + switch(hdrFormat) + { + case HDR_TYPE_SDR: + ret=tvContentFormatType_SDR; + break; + case HDR_TYPE_HDR10: + ret=tvContentFormatType_HDR10; + break; + case HDR_TYPE_HDR10PLUS: + ret=tvContentFormatType_HDR10PLUS; + break; + case HDR_TYPE_DOVI: + ret=tvContentFormatType_DOVI; + break; + case HDR_TYPE_HLG: + ret=tvContentFormatType_HLG; + break; + default: + break; + } + return ret; + } + + + int AVOutputTV::ReadCapablitiesFromConf(std::string &rangeInfo,std::string &pqmodeInfo,std::string &formatInfo,std::string &sourceInfo, + std::string param, std::string & isPlatformSupport, std::string & indexInfo) + { + int ret = 0; + + try { + CIniFile inFile(CAPABLITY_FILE_NAME); + std::string configString; + if ((param == "DolbyVisionMode") || (param == "Backlight") ) { + configString = param + ".platformsupport"; + isPlatformSupport = inFile.Get(configString); + printf(" platfromsupport : %s\n",isPlatformSupport.c_str() ); + } + + if ( (param == "ColorTemperature") || (param == "DimmingMode") || + ( param == "AutoBacklightControl") || (param == "DolbyVisionMode") || + (param == "HDR10Mode") || (param == "HLGMode") || (param == "AspectRatio") || + (param == "PictureMode") || (param == "VideoSource") || (param == "VideoFormat") || + (param == "VideoFrameRate") ) { + configString = param + ".range"; + rangeInfo = inFile.Get(configString); + printf(" String Range info : %s\n",rangeInfo.c_str() ); + } else { + configString = param + ".range_from"; + rangeInfo = inFile.Get(configString); + configString = param + ".range_to"; + rangeInfo += ","+inFile.Get(configString); + printf(" Integer Range Info : %s\n",rangeInfo.c_str() ); + } + + if ((param == "VideoSource") || (param == "PictureMode") || (param == "VideoFormat") ) { + configString.clear(); + configString = param + ".index"; + indexInfo = inFile.Get(configString); + printf("Index value %s\n", indexInfo.c_str()); + } + + configString.clear(); + configString = param + ".pqmode"; + pqmodeInfo = inFile.Get(configString); + configString = param + ".format"; + formatInfo = inFile.Get(configString); + configString = param + ".source"; + sourceInfo = inFile.Get(configString); + ret = 0; + } + catch(const boost::property_tree::ptree_error &e) { + printf("%s: error %s::config table entry not found in ini file\n",__FUNCTION__,e.what()); + ret = -1; + } + return ret; + } + void AVOutputTV::getDimmingModeStringFromEnum(int value, std::string &toStore) { const char *color_temp_string[] = { @@ -1397,9 +1515,9 @@ namespace Plugin { std::string tr181_param_name; tvVideoSrcType_t currentSource = VIDEO_SOURCE_IP; - ret = GetCurrentSource(¤tSource); + ret = GetCurrentVideoSource(¤tSource); if(ret != tvERROR_NONE) { - LOGERR("GetCurrentSource() Failed set source to default\n"); + LOGERR("GetCurrentVideoSource() Failed set source to default\n"); return 0; } @@ -1417,6 +1535,7 @@ namespace Plugin { tr181ErrorCode_t err = getLocalParam(rfc_caller_id, tr181_param_name.c_str(), ¶m); if ( err == tr181Success ) { strncpy(picMode, param.value, strlen(param.value)+1); + picMode[strlen(param.value)] = '\0'; LOGINFO("getLocalParam success, mode = %s\n", picMode); return 1; } @@ -1459,6 +1578,32 @@ namespace Plugin { return ret; } + tvDolbyMode_t AVOutputTV::GetDolbyVisionEnumFromModeString(const char* modeString) + { + if (strcmp(modeString, "Invalid") == 0) { + return tvDolbyMode_Invalid; + } else if (strcmp(modeString, "Dark") == 0) { + return tvDolbyMode_Dark; + } else if (strcmp(modeString, "Bright") == 0) { + return tvDolbyMode_Bright; + } else if (strcmp(modeString, "Game") == 0) { + return tvDolbyMode_Game; + } else if (strcmp(modeString, "HDR10 Dark") == 0) { + return tvHDR10Mode_Dark; + } else if (strcmp(modeString, "HDR10 Bright") == 0) { + return tvHDR10Mode_Bright; + } else if (strcmp(modeString, "HDR10 Game") == 0) { + return tvHDR10Mode_Game; + } else if (strcmp(modeString, "HLG Dark") == 0) { + return tvHLGMode_Dark; + } else if (strcmp(modeString, "HLG Bright") == 0) { + return tvHLGMode_Bright; + } else if (strcmp(modeString, "HLG Game") == 0) { + return tvHLGMode_Game; + } + + return tvDolbyMode_Invalid; // Default case for invalid input + } std::string AVOutputTV::getDolbyModeStringFromEnum( tvDolbyMode_t mode) diff --git a/AVOutput/CHANGELOG.md b/AVOutput/CHANGELOG.md index f46b29bc1c..1c4cc3ed7b 100644 --- a/AVOutput/CHANGELOG.md +++ b/AVOutput/CHANGELOG.md @@ -15,6 +15,14 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.11] - 2025-01-02 +### Security +- Resolved security vulnerabilities + +## [1.0.10] - 2024-12-23 +### Added +- ODM API removal changes phase 1 + ## [1.0.9] - 2024-10-04 ### Fixed - PQMode Camel Case issue diff --git a/DeviceIdentification/CHANGELOG.md b/DeviceIdentification/CHANGELOG.md index 8118274e3f..0e15aa0b52 100644 --- a/DeviceIdentification/CHANGELOG.md +++ b/DeviceIdentification/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.6] - 2024-12-30 +### Fixed +- Added method for retrieving Serial number if existing implementation fails to retrive the serial number. + ## [1.0.6] - 2024-05-28 ### Fixed - Added methods for retrieving Serial number, Chip Id and Firmware version for Broadcom Devices. diff --git a/DeviceIdentification/CMakeLists.txt b/DeviceIdentification/CMakeLists.txt index e3a5a5cdad..ce0e1cae5b 100644 --- a/DeviceIdentification/CMakeLists.txt +++ b/DeviceIdentification/CMakeLists.txt @@ -126,4 +126,5 @@ target_include_directories(${MODULE_NAME} install(TARGETS ${MODULE_NAME} DESTINATION lib/${STORAGE_DIRECTORY}/plugins) +target_include_directories(${MODULE_NAME} PRIVATE ../helpers) write_config(${PLUGIN_NAME}) diff --git a/DeviceIdentification/DeviceIdentification.cpp b/DeviceIdentification/DeviceIdentification.cpp index d770291660..8f9fdaccf9 100644 --- a/DeviceIdentification/DeviceIdentification.cpp +++ b/DeviceIdentification/DeviceIdentification.cpp @@ -20,10 +20,18 @@ #include "DeviceIdentification.h" #include "IdentityProvider.h" #include +#include "tracing/Logging.h" +#include "UtilsJsonRpc.h" +#include "UtilsController.h" +#ifdef USE_THUNDER_R4 +#include +#else +#include +#endif /* USE_THUNDER_R4 */ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 6 +#define API_VERSION_NUMBER_PATCH 7 namespace WPEFramework { namespace { @@ -154,6 +162,7 @@ namespace Plugin { string DeviceIdentification::GetDeviceId() const { string result; + string serial; #ifndef DISABLE_DEVICEID_CONTROL ASSERT(_identifier != nullptr); @@ -165,6 +174,25 @@ namespace Plugin { if (myBuffer[0] != 0) { result = Core::SystemInfo::Instance().Id(myBuffer, ~0); } + else + { + serial = RetrieveSerialNumberThroughCOMRPC(); + + if (!serial.empty()) { + uint8_t ret = serial.length(); + + if (ret > (sizeof(myBuffer) - 1)){ + ret = sizeof(myBuffer) - 1; + } + myBuffer[0] = ret; + ::memcpy(&(myBuffer[1]), serial.c_str(), ret); + + if(myBuffer[0] != 0){ + result = Core::SystemInfo::Instance().Id(myBuffer, ~0); + } + } + } + } #else // extract DeviceId set by Thunder @@ -184,7 +212,34 @@ namespace Plugin { #endif return result; } - + string DeviceIdentification::RetrieveSerialNumberThroughCOMRPC() const + { + std::string Number; + if (_service) + { + PluginHost::IShell::state state; + + if ((Utils::getServiceState(_service, "DeviceInfo", state) == Core::ERROR_NONE) && (state != PluginHost::IShell::state::ACTIVATED)) + { + Utils::activatePlugin(_service, "DeviceInfo"); + } + if ((Utils::getServiceState(_service, "DeviceInfo", state) == Core::ERROR_NONE) && (state == PluginHost::IShell::state::ACTIVATED)) + { + auto _remoteDeviceInfoObject = _service->QueryInterfaceByCallsign("DeviceInfo"); + + if(_remoteDeviceInfoObject) + { + _remoteDeviceInfoObject->SerialNumber(Number); + _remoteDeviceInfoObject->Release(); + } + } + else + { + LOGERR("Failed to create DeviceInfo object\n"); + } + } + return Number; + } void DeviceIdentification::Info(JsonData::DeviceIdentification::DeviceidentificationData& deviceInfo) const { deviceInfo.Firmwareversion = _identifier->FirmwareVersion(); diff --git a/DeviceIdentification/DeviceIdentification.h b/DeviceIdentification/DeviceIdentification.h index 12eb325e0e..94de6f9783 100644 --- a/DeviceIdentification/DeviceIdentification.h +++ b/DeviceIdentification/DeviceIdentification.h @@ -94,6 +94,7 @@ namespace Plugin { uint32_t get_deviceidentification(JsonData::DeviceIdentification::DeviceidentificationData& response) const; string GetDeviceId() const; + string RetrieveSerialNumberThroughCOMRPC() const; void Info(JsonData::DeviceIdentification::DeviceidentificationData&) const; void Deactivated(RPC::IRemoteConnection* connection); diff --git a/DisplaySettings/CHANGELOG.md b/DisplaySettings/CHANGELOG.md index 4f0195c5c3..e7c0ccb12a 100644 --- a/DisplaySettings/CHANGELOG.md +++ b/DisplaySettings/CHANGELOG.md @@ -16,6 +16,18 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [2.0.4] - 2025-01-02 +### Security +- Resolved security vulnerabilities + +## [2.0.3] - 2024-12-29 +### Removed +- Removed irmgr references from rdkservices. + +## [2.0.2] - 2024-12-03 +### Fixed +- Corrected the documentation for several functions to make them more accurate for their actual use. + ## [2.0.1] - 2024-12-03 ### Fixed - Fixed unhandled exception that was occasionally causing a crash if thread creation failed. diff --git a/DisplaySettings/DisplaySettings.cpp b/DisplaySettings/DisplaySettings.cpp index a771a5e82e..1ae4efb0af 100644 --- a/DisplaySettings/DisplaySettings.cpp +++ b/DisplaySettings/DisplaySettings.cpp @@ -85,7 +85,7 @@ using namespace std; #define API_VERSION_NUMBER_MAJOR 2 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 0 +#define API_VERSION_NUMBER_PATCH 4 static bool isCecEnabled = false; static bool isResCacheUpdated = false; @@ -2268,6 +2268,7 @@ namespace WPEFramework { { IARM_Bus_PWRMgr_StandbyVideoState_Param_t param; strncpy(param.port, portname.c_str(), PWRMGR_MAX_VIDEO_PORT_NAME_LENGTH); + param.port[sizeof(param.port) - 1] = '\0'; if(IARM_RESULT_SUCCESS != IARM_Bus_Call(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_API_GetStandbyVideoState, ¶m, sizeof(param))) { LOGERR("Port: %s. enable:%d", param.port, param.isEnabled); @@ -2291,6 +2292,7 @@ namespace WPEFramework { { dsMgrStandbyVideoStateParam_t param; strncpy(param.port, portname.c_str(), PWRMGR_MAX_VIDEO_PORT_NAME_LENGTH); + param.port[sizeof(param.port) - 1] = '\0'; if(IARM_RESULT_SUCCESS != IARM_Bus_Call(IARM_BUS_DSMGR_NAME, IARM_BUS_DSMGR_API_GetStandbyVideoState, ¶m, sizeof(param))) { LOGERR("Port: %s. enable:%d", param.port, param.isEnabled); diff --git a/DisplaySettings/DisplaySettings.h b/DisplaySettings/DisplaySettings.h index da59cd9fc1..0b6319ef64 100644 --- a/DisplaySettings/DisplaySettings.h +++ b/DisplaySettings/DisplaySettings.h @@ -25,7 +25,6 @@ #include "dsTypes.h" #include "tptimer.h" #include "libIARM.h" -#include "irMgr.h" #include "pwrMgr.h" #include "rfcapi.h" #include @@ -33,6 +32,7 @@ #include #include + namespace WPEFramework { namespace Plugin { diff --git a/DisplaySettings/DisplaySettings.json b/DisplaySettings/DisplaySettings.json index d497d1b877..59fc7fe210 100644 --- a/DisplaySettings/DisplaySettings.json +++ b/DisplaySettings/DisplaySettings.json @@ -28,7 +28,7 @@ "type": "array", "items": { "type": "string", - "example": "`SDR`, `HDR10`, `HDR10PLUS`, `HLG`, `DV`, `Technicolor Prime`" + "example": "`NONE`, `SDR`, `HDR10`, `HDR10PLUS`, `HLG`, `DV`, `Technicolor Prime`" } }, "currentAudioFormat": { @@ -2073,17 +2073,17 @@ } }, "setForceHDRMode": { - "summary": "Enables or disables the force HDR mode. If enabled, the HDR format that is currently configured on the device is used.", + "summary": " This API force the output HDR video format passed as input arumgents. If force output video format is set as \"NONE\" or this API not called video format changes as per input video format type", "params": { "type": "object", "properties": { "hdr_mode": { - "summary": "`true` to force the HDR format or `false` to reset the mode to the default.", - "type": "boolean", - "example": true + "$ref": "#/definitions/supportedVideoFormat" } }, - "required": [] + "required": [ + "hdr_mode" + ] }, "result": { "$ref": "#/common/result" @@ -2224,22 +2224,22 @@ "operation": { "summary": "The audio profile state", "type": "string", - "example": "" + "example": "`ADD`, `REMOVE`" }, "profileName": { "summary": "An MS12 audio profile name from `getSupportedMS12AudioProfile`", "type": "string", - "example": "Sports" + "example": "`Sports`, `User`" }, "ms12SettingsName": { "summary": "An ms12 setting name", "type": "string", - "example": "Dialog Enhance" + "example": "`DialogEnhance`, `VolumeLevellerMode`, `VolumeLevellerLevel`, `BassEnhancer`, `SurroundVirtualizerMode`, `SurroundVirtualizerLevel`" }, "ms12SettingsValue": { "summary": "The value to set", "type": "string", - "example": "On" + "example": "`0`, `1`, `2`" } }, "required": [ diff --git a/DisplaySettings/cmake/FindIARMBus.cmake b/DisplaySettings/cmake/FindIARMBus.cmake index 9764ced5ea..f4554b1555 100644 --- a/DisplaySettings/cmake/FindIARMBus.cmake +++ b/DisplaySettings/cmake/FindIARMBus.cmake @@ -27,11 +27,10 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES rdk/iarmmgrs/ir) set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS}) -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS}) +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") include(FindPackageHandleStandardArgs) diff --git a/FrameRate/CHANGELOG.md b/FrameRate/CHANGELOG.md index b9aed29794..ce8f2422a2 100644 --- a/FrameRate/CHANGELOG.md +++ b/FrameRate/CHANGELOG.md @@ -16,6 +16,14 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.8] - 2025-01-02 +### Security +- Resolved security vulnerabilities + +## [1.0.7] - 2024-12-18 +### Removed +- remove irmgr reference from rdkservices. + ## [1.0.6] - 2024-05-25 ### Added - Make plugin autostart configurable from recipe diff --git a/FrameRate/FrameRate.cpp b/FrameRate/FrameRate.cpp index 21c21a8c02..660348a68f 100644 --- a/FrameRate/FrameRate.cpp +++ b/FrameRate/FrameRate.cpp @@ -51,7 +51,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 6 +#define API_VERSION_NUMBER_PATCH 8 namespace WPEFramework { @@ -461,7 +461,8 @@ namespace WPEFramework switch (eventId) { case IARM_BUS_DSMGR_EVENT_DISPLAY_FRAMRATE_PRECHANGE: IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; - strcpy(dispFrameRate,eventData->data.DisplayFrameRateChange.framerate); + strncpy(dispFrameRate,eventData->data.DisplayFrameRateChange.framerate, sizeof(dispFrameRate)); + dispFrameRate[sizeof(dispFrameRate) - 1] = '\0'; break; } } @@ -487,7 +488,8 @@ namespace WPEFramework switch (eventId) { case IARM_BUS_DSMGR_EVENT_DISPLAY_FRAMRATE_POSTCHANGE: IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data; - strcpy(dispFrameRate,eventData->data.DisplayFrameRateChange.framerate); + strncpy(dispFrameRate,eventData->data.DisplayFrameRateChange.framerate, sizeof(dispFrameRate)); + dispFrameRate[sizeof(dispFrameRate) - 1] = '\0'; break; } } diff --git a/FrameRate/cmake/FindIARMBus.cmake b/FrameRate/cmake/FindIARMBus.cmake index cad92b7305..7d32a1ba0a 100644 --- a/FrameRate/cmake/FindIARMBus.cmake +++ b/FrameRate/cmake/FindIARMBus.cmake @@ -27,13 +27,12 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES rdk/iarmmgrs/ir) find_path(IARMRECEIVER_INCLUDE_DIRS NAMES receiverMgr.h PATH_SUFFIXES rdk/iarmmgrs/receiver) find_path(IARMPWR_INCLUDE_DIRS NAMES pwrMgr.h PATH_SUFFIXES rdk/iarmmgrs-hal) set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) diff --git a/MaintenanceManager/CHANGELOG.md b/MaintenanceManager/CHANGELOG.md index 6ab8de306b..c2d8effadb 100644 --- a/MaintenanceManager/CHANGELOG.md +++ b/MaintenanceManager/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.39] - 2024-12-18 +### Removed +- remove irmgr reference from rdkservices. + ## [1.0.38] - 2024-11-26 ### Added - MaintenanceManager is stuck at MAINTENANCE_STARTED in non-WAI case, when SUPPRESSED_MAINTENANCE is enabled with no Skip Firmware diff --git a/MaintenanceManager/MaintenanceManager.cpp b/MaintenanceManager/MaintenanceManager.cpp index 5527f602ce..c7cec3513e 100644 --- a/MaintenanceManager/MaintenanceManager.cpp +++ b/MaintenanceManager/MaintenanceManager.cpp @@ -68,7 +68,7 @@ using namespace std; #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 36 +#define API_VERSION_NUMBER_PATCH 39 #define SERVER_DETAILS "127.0.0.1:9998" diff --git a/MaintenanceManager/MaintenanceManager.h b/MaintenanceManager/MaintenanceManager.h index 695d91a24d..554bdd8a0f 100644 --- a/MaintenanceManager/MaintenanceManager.h +++ b/MaintenanceManager/MaintenanceManager.h @@ -28,7 +28,6 @@ #include "tracing/Logging.h" #if defined(USE_IARMBUS) || defined(USE_IARM_BUS) #include "libIARM.h" -#include "irMgr.h" #include "pwrMgr.h" #include "maintenanceMGR.h" /* IARM INTERFACE HELPER */ #endif /* USE_IARMBUS || USE_IARM_BUS */ diff --git a/MaintenanceManager/cmake/FindIARMBus.cmake b/MaintenanceManager/cmake/FindIARMBus.cmake index 2b60f4e31f..9050971a62 100644 --- a/MaintenanceManager/cmake/FindIARMBus.cmake +++ b/MaintenanceManager/cmake/FindIARMBus.cmake @@ -27,14 +27,13 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES rdk/iarmmgrs/ir) find_path(IARMSYS_INCLUDE_DIRS NAMES sysMgr.h PATH_SUFFIXES rdk/iarmmgrs/sysmgr) find_path(IARMPWR_INCLUDE_DIRS NAMES pwrMgr.h PATH_SUFFIXES rdk/iarmmgrs-hal) set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} ) -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} ) +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) diff --git a/Miracast/CHANGELOG.md b/Miracast/CHANGELOG.md index 1b85812f94..15e252db95 100644 --- a/Miracast/CHANGELOG.md +++ b/Miracast/CHANGELOG.md @@ -13,6 +13,10 @@ All notable changes to this RDK Service will be documented in this file. Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. For more details, refer to versioning section under Main README. +## [1.0.12] - 2025-01-02 +### Security +- Resolved security vulnerabilities + ## [1.0.11] - 2024-12-05 ### Fixed - Fixed the SIGILL crash while failed to unregister the Power Event. diff --git a/Miracast/MiracastPlayer/MiracastPlayer.cpp b/Miracast/MiracastPlayer/MiracastPlayer.cpp index a59037444a..5069d219cb 100644 --- a/Miracast/MiracastPlayer/MiracastPlayer.cpp +++ b/Miracast/MiracastPlayer/MiracastPlayer.cpp @@ -187,9 +187,13 @@ namespace WPEFramework sink_dev_ip = device_parameters["sink_dev_ip"].String(); strncpy( rtsp_hldr_msgq_data.source_dev_ip, source_dev_ip.c_str() , sizeof(rtsp_hldr_msgq_data.source_dev_ip)); + rtsp_hldr_msgq_data.source_dev_ip[sizeof(rtsp_hldr_msgq_data.source_dev_ip) - 1] = '\0'; strncpy( rtsp_hldr_msgq_data.source_dev_mac, source_dev_mac.c_str() , sizeof(rtsp_hldr_msgq_data.source_dev_mac)); + rtsp_hldr_msgq_data.source_dev_mac[sizeof(rtsp_hldr_msgq_data.source_dev_mac) - 1] = '\0'; strncpy( rtsp_hldr_msgq_data.source_dev_name, source_dev_name.c_str() , sizeof(rtsp_hldr_msgq_data.source_dev_name)); + rtsp_hldr_msgq_data.source_dev_name[sizeof(rtsp_hldr_msgq_data.source_dev_name) - 1] = '\0'; strncpy( rtsp_hldr_msgq_data.sink_dev_ip, sink_dev_ip.c_str() , sizeof(rtsp_hldr_msgq_data.sink_dev_ip)); + rtsp_hldr_msgq_data.sink_dev_ip[sizeof(rtsp_hldr_msgq_data.sink_dev_ip) - 1] = '\0'; rtsp_hldr_msgq_data.state = RTSP_START_RECEIVE_MSGS; success = true; @@ -692,8 +696,10 @@ namespace WPEFramework } else { - strcpy( stMsgQ.src_dev_name, client_name.c_str()); - strcpy( stMsgQ.src_dev_mac_addr, client_mac.c_str()); + strncpy( stMsgQ.src_dev_name, client_name.c_str(), sizeof(stMsgQ.src_dev_name)); + stMsgQ.src_dev_name[sizeof(stMsgQ.src_dev_name) - 1] = '\0'; + strncpy( stMsgQ.src_dev_mac_addr, client_mac.c_str(), sizeof(stMsgQ.src_dev_mac_addr)); + stMsgQ.src_dev_mac_addr[sizeof(stMsgQ.src_dev_mac_addr) - 1] = '\0'; MIRACASTLOG_INFO("Given 'NAME, MAC and state' are[%s-%s-%s]", client_name.c_str(), diff --git a/Miracast/MiracastService/MiracastController.cpp b/Miracast/MiracastService/MiracastController.cpp index 67e182cd91..9e0e7cf808 100644 --- a/Miracast/MiracastService/MiracastController.cpp +++ b/Miracast/MiracastService/MiracastController.cpp @@ -464,6 +464,7 @@ void MiracastController::remove_P2PGroupInstance(void) if ( true == m_groupInfo->isGO ) { strncpy( commandBuffer , "ps -ax | awk '/dnsmasq -p0 -i/ && !/grep/ {print $1}' | xargs kill -9" , sizeof(commandBuffer)); + commandBuffer[sizeof(commandBuffer) - 1] = '\0'; MIRACASTLOG_INFO("Terminate old dnsmasq instance: [%s]",commandBuffer); MiracastCommon::execute_SystemCommand(commandBuffer); memset( commandBuffer , 0x00 , sizeof(commandBuffer)); @@ -475,6 +476,7 @@ void MiracastController::remove_P2PGroupInstance(void) else { strncpy( commandBuffer , "ps -ax | awk '/p2p_udhcpc/ && !/grep/ {print $1}' | xargs kill -9" , sizeof(commandBuffer)); + commandBuffer[sizeof(commandBuffer) - 1] = '\0'; MIRACASTLOG_INFO("Terminate old udhcpc p2p instance : [%s]", commandBuffer); MiracastCommon::execute_SystemCommand(commandBuffer); } @@ -518,7 +520,8 @@ void MiracastController::event_handler(P2P_EVENTS eventId, void *data, size_t le if (nullptr != m_controller_thread){ controller_msgq_data.msg_type = P2P_MSG; controller_msgq_data.state = convertP2PtoSessionActions(eventId); - strcpy(controller_msgq_data.msg_buffer, event_buffer.c_str()); + strncpy(controller_msgq_data.msg_buffer, event_buffer.c_str(), sizeof(controller_msgq_data.msg_buffer)); + controller_msgq_data.msg_buffer[sizeof(controller_msgq_data.msg_buffer) - 1] = '\0'; MIRACASTLOG_INFO("event_handler to Controller Action[%#08X] buffer:%s ", controller_msgq_data.state, event_buffer.c_str()); m_controller_thread->send_message(&controller_msgq_data, sizeof(controller_msgq_data)); @@ -1394,6 +1397,7 @@ void MiracastController::restart_session_discovery(std::string& mac_address) if ( !mac_address.empty()) { strncpy(controller_msgq_data.source_dev_mac, mac_address.c_str(),sizeof(controller_msgq_data.source_dev_mac)); + controller_msgq_data.source_dev_mac[sizeof(controller_msgq_data.source_dev_mac) - 1] = '\0'; } controller_msgq_data.state = CONTROLLER_RESTART_DISCOVERING; send_thundermsg_to_controller_thread(controller_msgq_data); @@ -1419,6 +1423,7 @@ void MiracastController::accept_client_connection(std::string is_accepted) { MIRACASTLOG_INFO("[MIRACAST_SERVICE_ACCEPT_CLIENT]"); strncpy(controller_msgq_data.source_dev_mac, m_current_device_mac_addr.c_str(),sizeof(controller_msgq_data.source_dev_mac)); + controller_msgq_data.source_dev_mac[sizeof(controller_msgq_data.source_dev_mac) - 1] = '\0'; controller_msgq_data.state = CONTROLLER_CONNECT_REQ_FROM_THUNDER; } else @@ -1448,9 +1453,13 @@ void MiracastController::switch_launch_request_context(std::string& source_dev_i sink_dev_ip.c_str(), source_dev_name.c_str()); strncpy(controller_msgq_data.source_dev_ip, source_dev_ip.c_str(),sizeof(controller_msgq_data.source_dev_ip)); + controller_msgq_data.source_dev_ip[sizeof(controller_msgq_data.source_dev_ip) - 1] = '\0'; strncpy(controller_msgq_data.source_dev_mac, source_dev_mac.c_str(),sizeof(controller_msgq_data.source_dev_mac)); + controller_msgq_data.source_dev_mac[sizeof(controller_msgq_data.source_dev_mac) - 1] = '\0'; strncpy(controller_msgq_data.source_dev_name, source_dev_name.c_str(),sizeof(controller_msgq_data.source_dev_name)); + controller_msgq_data.source_dev_name[sizeof(controller_msgq_data.source_dev_name) - 1] = '\0'; strncpy(controller_msgq_data.sink_dev_ip, sink_dev_ip.c_str(),sizeof(controller_msgq_data.sink_dev_ip)); + controller_msgq_data.sink_dev_ip[sizeof(controller_msgq_data.sink_dev_ip) - 1] = '\0'; controller_msgq_data.state = CONTROLLER_SWITCH_LAUNCH_REQ_CTX; send_thundermsg_to_controller_thread(controller_msgq_data); } diff --git a/Miracast/MiracastService/MiracastService.cpp b/Miracast/MiracastService/MiracastService.cpp index 2833c1c8c3..f94658e7d3 100644 --- a/Miracast/MiracastService/MiracastService.cpp +++ b/Miracast/MiracastService/MiracastService.cpp @@ -60,7 +60,7 @@ using namespace std; #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 11 +#define API_VERSION_NUMBER_PATCH 12 #define SERVER_DETAILS "127.0.0.1:9998" #define SYSTEM_CALLSIGN "org.rdk.System" @@ -934,8 +934,10 @@ namespace WPEFramework } else { - strcpy( stMsgQ.src_dev_name, client_name.c_str()); - strcpy( stMsgQ.src_dev_mac_addr, client_mac.c_str()); + strncpy( stMsgQ.src_dev_name, client_name.c_str(), sizeof(stMsgQ.src_dev_name)); + stMsgQ.src_dev_name[sizeof(stMsgQ.src_dev_name) - 1] = '\0'; + strncpy( stMsgQ.src_dev_mac_addr, client_mac.c_str(), sizeof(stMsgQ.src_dev_mac_addr)); + stMsgQ.src_dev_mac_addr[sizeof(stMsgQ.src_dev_mac_addr) - 1] = '\0'; MIRACASTLOG_INFO("Given [NAME-MAC-state] are[%s-%s-%s]", client_name.c_str(), @@ -997,8 +999,10 @@ namespace WPEFramework } else { - strcpy( stMsgQ.src_dev_ip_addr, source_dev_ip.c_str()); - strcpy( stMsgQ.sink_ip_addr, sink_dev_ip.c_str()); + strncpy( stMsgQ.src_dev_ip_addr, source_dev_ip.c_str(), sizeof(stMsgQ.src_dev_ip_addr)); + stMsgQ.src_dev_ip_addr[sizeof(stMsgQ.src_dev_ip_addr) - 1] = '\0'; + strncpy( stMsgQ.sink_ip_addr, sink_dev_ip.c_str(), sizeof(stMsgQ.sink_ip_addr)); + stMsgQ.sink_ip_addr[sizeof(stMsgQ.sink_ip_addr) - 1] = '\0'; MIRACASTLOG_INFO("Given [Src-Sink-IP] are [%s-%s]", source_dev_ip.c_str(), @@ -1048,6 +1052,7 @@ namespace WPEFramework { MIRACASTLOG_INFO("!!! NEED TO STOP ONGOING SESSION !!!"); strncpy(commandBuffer,"curl -H \"Authorization: Bearer `WPEFrameworkSecurityUtility | cut -d '\"' -f 4`\" --header \"Content-Type: application/json\" --request POST --data '{\"jsonrpc\":\"2.0\", \"id\":3,\"method\":\"org.rdk.MiracastPlayer.1.stopRequest\", \"params\":{\"reason\": \"NEW_CONNECTION\"}}' http://127.0.0.1:9998/jsonrpc",sizeof(commandBuffer)); + commandBuffer[sizeof(commandBuffer) - 1] = '\0'; MIRACASTLOG_INFO("Stopping old Session by [%s]",commandBuffer); MiracastCommon::execute_SystemCommand(commandBuffer); sleep(1); diff --git a/Network/CHANGELOG.md b/Network/CHANGELOG.md index 8a4230cc9d..ce791fc39b 100644 --- a/Network/CHANGELOG.md +++ b/Network/CHANGELOG.md @@ -16,10 +16,15 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. -## [1.3.12] - 2024-06-19 + +## [1.3.13] - 2025-01-07 ### Fixed - Fix crash in the WPEFramework connectivity monitor destructor +## [1.3.12] - 2025-01-02 +### Security +- Resolved security vulnerabilities + ## [1.3.11] - 2024-06-19 ### Fixed - onInternetStatus event not posting error fix diff --git a/Network/Network.cpp b/Network/Network.cpp index 0396433b7b..10cb0c1fe7 100644 --- a/Network/Network.cpp +++ b/Network/Network.cpp @@ -859,10 +859,15 @@ typedef struct _IARM_BUS_NetSrvMgr_Iface_EventData_t { iarmData.ipversion[sizeof(iarmData.ipversion) - 1] = '\0'; iarmData.autoconfig = autoconfig; strncpy(iarmData.ipaddress, ipaddr.c_str(), 16); + iarmData.ipaddress[sizeof(iarmData.ipaddress) - 1] = '\0'; strncpy(iarmData.netmask, netmask.c_str(), 16); + iarmData.netmask[sizeof(iarmData.netmask) - 1] = '\0'; strncpy(iarmData.gateway, gateway.c_str(), 16); + iarmData.gateway[sizeof(iarmData.gateway) - 1] = '\0'; strncpy(iarmData.primarydns, primarydns.c_str(), 16); + iarmData.primarydns[sizeof(iarmData.primarydns) - 1] = '\0'; strncpy(iarmData.secondarydns, secondarydns.c_str(), 16); + iarmData.secondarydns[sizeof(iarmData.secondarydns) - 1] = '\0'; iarmData.isSupported = false; if (!autoconfig) diff --git a/RemoteActionMapping/CHANGELOG.md b/RemoteActionMapping/CHANGELOG.md index 324bbe618e..ebd6735528 100644 --- a/RemoteActionMapping/CHANGELOG.md +++ b/RemoteActionMapping/CHANGELOG.md @@ -15,6 +15,11 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. + +## [1.0.9] - 2024-12-18 +### Removed +- remove irmgr reference from rdkservices. + ## [1.0.8] - 2024-03-29 ### Security - Resolved security vulnerabilities diff --git a/RemoteActionMapping/CMakeLists.txt b/RemoteActionMapping/CMakeLists.txt index 2d5a3fbf43..a8587c07a2 100644 --- a/RemoteActionMapping/CMakeLists.txt +++ b/RemoteActionMapping/CMakeLists.txt @@ -47,8 +47,6 @@ if (CTRLM_FOUND) target_include_directories(${MODULE_NAME} PRIVATE ${CTRLM_INCLUDE_DIRS}) find_package(IARMBus) target_include_directories(${MODULE_NAME} PRIVATE ${IARMBUS_INCLUDE_DIRS}) - find_package(IRMGR) - target_include_directories(${MODULE_NAME} PRIVATE ${IRMGR_INCLUDE_DIRS}) target_link_libraries(${MODULE_NAME} PRIVATE ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${IARMBUS_LIBRARIES}) else (CTRLM_FOUND) target_link_libraries(${MODULE_NAME} PRIVATE ${NAMESPACE}Plugins::${NAMESPACE}Plugins) diff --git a/RemoteActionMapping/RemoteActionMapping.cpp b/RemoteActionMapping/RemoteActionMapping.cpp index 5920d0e3ac..0d0a12cb8c 100644 --- a/RemoteActionMapping/RemoteActionMapping.cpp +++ b/RemoteActionMapping/RemoteActionMapping.cpp @@ -77,7 +77,7 @@ const int supported_irrfdb_slots_size = sizeof(supported_irrfdb_slots) / sizeof( #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 8 +#define API_VERSION_NUMBER_PATCH 9 using namespace std; diff --git a/RemoteActionMapping/cmake/FindIARMBus.cmake b/RemoteActionMapping/cmake/FindIARMBus.cmake index 212699aac4..9b25431324 100644 --- a/RemoteActionMapping/cmake/FindIARMBus.cmake +++ b/RemoteActionMapping/cmake/FindIARMBus.cmake @@ -27,11 +27,11 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -find_path(IRMGR_INCLUDE_DIRS NAMES irMgr.h comcastIrKeyCodes.h PATH_SUFFIXES rdk/iarmmgrs/ir rdk/iarmmgrs-hal) +find_path(IRMGR_INCLUDE_DIRS NAMES comcastIrKeyCodes.h PATH_SUFFIXES rdk/iarmmgrs-hal) set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IRMGR_INCLUDE_DIRS}) -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IRMGR_INCLUDE_DIRS} CACHE PATH "Paths to IARMBus include") +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS}) +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} CACHE PATH "Paths to IARMBus include") include(FindPackageHandleStandardArgs) diff --git a/StateObserver/CHANGELOG.md b/StateObserver/CHANGELOG.md index 90aca4d5e9..5d5156fc3e 100644 --- a/StateObserver/CHANGELOG.md +++ b/StateObserver/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.4] - 2025-01-02 +### Security +- Resolved security vulnerabilities + ## [1.0.3] - 2023-09-12 ### Added - Implement Thunder Plugin Configuration for Kirkstone builds(CMake-3.20 & above) diff --git a/StateObserver/StateObserver.cpp b/StateObserver/StateObserver.cpp index 35657629a9..1bb6e86896 100644 --- a/StateObserver/StateObserver.cpp +++ b/StateObserver/StateObserver.cpp @@ -44,7 +44,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 1 +#define API_VERSION_NUMBER_PATCH 4 #define DEBUG_INFO 0 namespace WPEFramework { @@ -813,8 +813,8 @@ namespace WPEFramework { { systemStates.dac_init_timestamp.state = state; systemStates.dac_init_timestamp.error = error; - strncpy(systemStates.dac_init_timestamp.payload,payload,strlen(payload)); - systemStates.dac_init_timestamp.payload[strlen(payload)]='\0'; + strncpy(systemStates.dac_init_timestamp.payload,payload,sizeof(systemStates.dac_init_timestamp.payload)); + systemStates.dac_init_timestamp.payload[sizeof(systemStates.dac_init_timestamp.payload) - 1]='\0'; if(StateObserver::_instance) StateObserver::_instance->setProp(params,SYSTEM_DAC_INIT_TIMESTAMP,state,error); string payload_str(payload); @@ -825,8 +825,8 @@ namespace WPEFramework { case IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_SERIAL_NO: { systemStates.card_serial_no.error =error; - strncpy(systemStates.card_serial_no.payload,payload,strlen(payload)); - systemStates.card_serial_no.payload[strlen(payload)]='\0'; + strncpy(systemStates.card_serial_no.payload,payload,sizeof(systemStates.card_serial_no.payload)); + systemStates.card_serial_no.payload[sizeof(systemStates.card_serial_no.payload) - 1]='\0'; params["propertyName"]=SYSTEM_CARD_SERIAL_NO; params["error"]=error; string payload_str(payload); @@ -837,8 +837,8 @@ namespace WPEFramework { case IARM_BUS_SYSMGR_SYSSTATE_STB_SERIAL_NO: { systemStates.stb_serial_no.error =error; - strncpy(systemStates.stb_serial_no.payload,payload,strlen(payload)); - systemStates.stb_serial_no.payload[strlen(payload)]='\0'; + strncpy(systemStates.stb_serial_no.payload,payload,sizeof(systemStates.stb_serial_no.payload)); + systemStates.stb_serial_no.payload[sizeof(systemStates.stb_serial_no.payload) - 1]='\0'; params["propertyName"]=SYSTEM_STB_SERIAL_NO; params["error"]=error; string payload_str(payload); @@ -973,8 +973,8 @@ namespace WPEFramework { case IARM_BUS_SYSMGR_SYSSTATE_ECM_MAC: { systemStates.ecm_mac.error =error; - strncpy(systemStates.ecm_mac.payload,payload,strlen(payload)); - systemStates.ecm_mac.payload[strlen(payload)]='\0'; + strncpy(systemStates.ecm_mac.payload,payload,sizeof(systemStates.ecm_mac.payload)); + systemStates.ecm_mac.payload[sizeof(systemStates.ecm_mac.payload) - 1]='\0'; params["propertyName"]=SYSTEM_ECM_MAC; params["error"]=error; string payload_str(payload); @@ -986,8 +986,8 @@ namespace WPEFramework { { systemStates.ip_mode.state=state; systemStates.ip_mode.error =error; - strncpy(systemStates.ip_mode.payload,payload,strlen(payload)); - systemStates.ip_mode.payload[strlen(payload)]='\0'; + strncpy(systemStates.ip_mode.payload,payload,sizeof(systemStates.ip_mode.payload)); + systemStates.ip_mode.payload[sizeof(systemStates.ip_mode.payload) - 1]='\0'; if(StateObserver::_instance) StateObserver::_instance->setProp(params,SYSTEM_IP_MODE,state,error); string payload_str(payload); diff --git a/SystemServices/CHANGELOG.md b/SystemServices/CHANGELOG.md index e48c10098e..d4a94ecbbb 100644 --- a/SystemServices/CHANGELOG.md +++ b/SystemServices/CHANGELOG.md @@ -16,6 +16,18 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [3.4.3] - 2025-01-02 +### Security +- Resolved security vulnerabilities + +## [3.4.2] - 2024-12-29 +### Removed +- Removed irmgr references from rdkservices. + +## [3.4.1] - 2024-12-03 +### Fixed +- Fixed the location of the get and set FSR functions within the documentation. + ## [3.4.0] - 2024-12-09 ### Added - Added implementation for BootType get API. diff --git a/SystemServices/System.json b/SystemServices/System.json index d481b0c5a7..1be538988c 100644 --- a/SystemServices/System.json +++ b/SystemServices/System.json @@ -1945,6 +1945,46 @@ ] } }, + "setFSRFlag":{ + "summary": "Set the FSR flag into the emmc raw area. This API will fail if you attempt to set the same value.", + "result": { + "type": "object", + "properties": { + "fsrFlag": { + "summary": "FSR flag", + "type": "boolean", + "example": true + }, + "success":{ + "$ref": "#/common/success" + } + }, + "required": [ + "fsrFlag", + "success" + ] + } + }, + "getFSRFlag":{ + "summary": "Get the FSR flag from the emmc raw area.", + "result": { + "type": "object", + "properties": { + "fsrFlag": { + "summary": "FSR flag.", + "type": "boolean", + "example": true + }, + "success":{ + "$ref": "#/common/success" + } + }, + "required": [ + "fsrFlag", + "success" + ] + } + }, "setPrivacyMode": { "summary": "Setting Privacy Mode.", "events": { @@ -2394,43 +2434,21 @@ ] } }, - "setFSRFlag":{ - "summary": "Set the FSR flag into the emmc raw area. This API will fail if you attempt to set the same value.", - "result": { - "type": "object", - "properties": { - "fsrFlag": { - "summary": "FSR flag", - "type": "boolean", - "example": true - }, - "success":{ - "$ref": "#/common/success" - } - }, - "required": [ - "fsrFlag", - "success" - ] - } - }, - "getFSRFlag":{ - "summary": "Get the FSR flag from the emmc raw area.", - "result": { - "type": "object", + "onBlocklistChanged":{ + "summary": "Triggers when the blocklist flag is modified", + "params": { + "type" :"object", "properties": { - "fsrFlag": { - "summary": "FSR flag.", - "type": "boolean", - "example": true + "oldBlocklistFlag": { + "$ref": "#/definitions/oldblocklist" }, - "success":{ - "$ref": "#/common/success" + "newBlocklistFlag": { + "$ref": "#/definitions/newblocklist" } }, "required": [ - "fsrFlag", - "success" + "oldBlocklistFlag", + "newBlocklistFlag" ] } } diff --git a/SystemServices/SystemServices.cpp b/SystemServices/SystemServices.cpp index 7eae266b66..098ef3bb57 100644 --- a/SystemServices/SystemServices.cpp +++ b/SystemServices/SystemServices.cpp @@ -67,7 +67,7 @@ using namespace std; #define API_VERSION_NUMBER_MAJOR 3 #define API_VERSION_NUMBER_MINOR 4 -#define API_VERSION_NUMBER_PATCH 0 +#define API_VERSION_NUMBER_PATCH 3 #define MAX_REBOOT_DELAY 86400 /* 24Hr = 86400 sec */ #define TR181_FW_DELAY_REBOOT "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AutoReboot.fwDelayReboot" @@ -661,6 +661,7 @@ namespace WPEFramework { IARM_Bus_PWRMgr_RebootParam_t rebootParam; strncpy(rebootParam.requestor, "SystemServices", sizeof(rebootParam.requestor)); + rebootParam.requestor[sizeof(rebootParam.requestor) - 1] = '\0'; strncpy(rebootParam.reboot_reason_custom, customReason.c_str(), sizeof(rebootParam.reboot_reason_custom)); rebootParam.reboot_reason_custom[sizeof(rebootParam.reboot_reason_custom) - 1] = '\0'; strncpy(rebootParam.reboot_reason_other, otherReason.c_str(), sizeof(rebootParam.reboot_reason_other)); @@ -1349,7 +1350,8 @@ namespace WPEFramework { if((strBLSplashScreenPath != "") && fileExists) { IARM_Bus_MFRLib_SetBLSplashScreen_Param_t mfrparam; - std::strcpy(mfrparam.path, strBLSplashScreenPath.c_str()); + std::strncpy(mfrparam.path, strBLSplashScreenPath.c_str(), sizeof(mfrparam.path)); + mfrparam.path[sizeof(mfrparam.path) - 1] = '\0'; IARM_Result_t result = IARM_Bus_Call(IARM_BUS_MFRLIB_NAME, IARM_BUS_MFRLIB_API_SetBlSplashScreen, (void *)&mfrparam, sizeof(mfrparam)); if (result != IARM_RESULT_SUCCESS){ LOGERR("Update failed. path: %s, fileExists %s, IARM result %d ",strBLSplashScreenPath.c_str(),fileExists ? "true" : "false",result); diff --git a/SystemServices/cmake/FindIARMBus.cmake b/SystemServices/cmake/FindIARMBus.cmake index d18eb98042..92864e6be3 100644 --- a/SystemServices/cmake/FindIARMBus.cmake +++ b/SystemServices/cmake/FindIARMBus.cmake @@ -27,14 +27,13 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES rdk/iarmmgrs/ir) find_path(IARMSYS_INCLUDE_DIRS NAMES sysMgr.h PATH_SUFFIXES rdk/iarmmgrs/sysmgr) find_path(IARMPWR_INCLUDE_DIRS NAMES pwrMgr.h PATH_SUFFIXES rdk/iarmmgrs-hal) set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} ) -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} ) +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMSYS_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) diff --git a/Warehouse/CHANGELOG.md b/Warehouse/CHANGELOG.md index b4d1dbf9d9..b861e565dd 100644 --- a/Warehouse/CHANGELOG.md +++ b/Warehouse/CHANGELOG.md @@ -16,6 +16,14 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.12] - 2025-01-02 +### Security +- Resolved security vulnerabilities + +## [1.0.11] - 2024-12-18 +### Removed +- remove irmgr reference from rdkservices + ## [1.0.10] - 2024-05-25 ### Added - Make plugin autostart configurable from recipe diff --git a/Warehouse/Warehouse.cpp b/Warehouse/Warehouse.cpp index 97a4e2e59d..d01c862e9d 100644 --- a/Warehouse/Warehouse.cpp +++ b/Warehouse/Warehouse.cpp @@ -86,7 +86,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 10 +#define API_VERSION_NUMBER_PATCH 12 namespace Utils { std::string formatIARMResult(IARM_Result_t result) @@ -331,7 +331,8 @@ namespace WPEFramework return false; } - strcpy(runScriptParam.script_path, script.c_str()); + strncpy(runScriptParam.script_path, script.c_str(), sizeof(runScriptParam.script_path)); + runScriptParam.script_path[sizeof(runScriptParam.script_path) - 1] = '\0'; IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_RunScript, &runScriptParam, sizeof(runScriptParam)); bool ok = runScriptParam.return_value == 0; diff --git a/Warehouse/cmake/FindIARMBus.cmake b/Warehouse/cmake/FindIARMBus.cmake index e6ee482545..65cce72e45 100644 --- a/Warehouse/cmake/FindIARMBus.cmake +++ b/Warehouse/cmake/FindIARMBus.cmake @@ -27,7 +27,6 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) #find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -#find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES rdk/iarmmgrs/ir) find_path(IARMIR_INCLUDE_DIRS NAMES sysMgr.h PATH_SUFFIXES rdk/iarmmgrs/sysmgr) find_path(IARMPWR_INCLUDE_DIRS NAMES pwrMgr.h PATH_SUFFIXES rdk/iarmmgrs-hal) diff --git a/WifiManager/CHANGELOG.md b/WifiManager/CHANGELOG.md index c7b4f359a3..bb4dd6ac4d 100644 --- a/WifiManager/CHANGELOG.md +++ b/WifiManager/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.10] - 2025-01-02 +### Security +- Resolved security vulnerabilities + ## [1.0.9] - 2023-09-21 ### Fixed - Fixed Update wifi state cache if wifi interface was enabled and added persist param in wifi setEnabled API to persist wifi state or not persist wifi state after reboot diff --git a/WifiManager/WifiManager.cpp b/WifiManager/WifiManager.cpp index a54c66c3e0..2aa1b873ee 100644 --- a/WifiManager/WifiManager.cpp +++ b/WifiManager/WifiManager.cpp @@ -31,7 +31,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 6 +#define API_VERSION_NUMBER_PATCH 10 namespace { using WPEFramework::Plugin::WifiManager; diff --git a/WifiManager/impl/WifiManagerState.cpp b/WifiManager/impl/WifiManagerState.cpp index a968cfe303..c0328bcbb3 100644 --- a/WifiManager/impl/WifiManagerState.cpp +++ b/WifiManager/impl/WifiManagerState.cpp @@ -114,6 +114,7 @@ uint32_t WifiManagerState::setEnabled(const JsonObject ¶meters, JsonObject & memset(¶m, 0, sizeof(param)); strncpy(param.setInterface, "WIFI", INTERFACE_SIZE - 1); + param.setInterface[sizeof(param.setInterface) - 1] = '\0'; param.isInterfaceEnabled = parameters["enable"].Boolean(); bool persist_t = false; getDefaultBoolParameter("persist", persist_t, false); diff --git a/WifiManager/impl/WifiManagerWPS.cpp b/WifiManager/impl/WifiManagerWPS.cpp index 3d1476ca5a..cbcd38918b 100644 --- a/WifiManager/impl/WifiManagerWPS.cpp +++ b/WifiManager/impl/WifiManagerWPS.cpp @@ -142,7 +142,9 @@ namespace WPEFramework memset(¶m, 0, sizeof(param)); strncpy(param.data.connect.ssid, parameters["ssid"].String().c_str(), SSID_SIZE - 1); + param.data.connect.ssid[sizeof(param.data.connect.ssid) - 1] = '\0'; strncpy(param.data.connect.passphrase, parameters["passphrase"].String().c_str(), PASSPHRASE_BUFF - 1); + param.data.connect.passphrase[sizeof(param.data.connect.passphrase) - 1] = '\0'; param.data.connect.security_mode = static_cast(parameters["securityMode"].Number()); IARM_Result_t retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_saveSSID, (void *)¶m, sizeof(param)); diff --git a/XCast/CHANGELOG.md b/XCast/CHANGELOG.md index d5e262872b..1f92b81457 100644 --- a/XCast/CHANGELOG.md +++ b/XCast/CHANGELOG.md @@ -15,6 +15,10 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [2.0.1] - 2025-01-02 +### Security +- Resolved security vulnerabilities + ## [2.0.0] - 2024-12-18 ### Added - Converted as OutOfProcess to eliminate RT communication and direct library calls used diff --git a/XCast/XCast.cpp b/XCast/XCast.cpp index b0d4620149..25297e7a77 100644 --- a/XCast/XCast.cpp +++ b/XCast/XCast.cpp @@ -67,7 +67,7 @@ using namespace std; #define API_VERSION_NUMBER_MAJOR 2 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 0 +#define API_VERSION_NUMBER_PATCH 1 namespace WPEFramework { @@ -802,6 +802,7 @@ void XCast::updateDynamicAppCache(JsonArray applications) memset ((void*)pDynamicAppConfig, '0', sizeof(DynamicAppConfig)); memset (pDynamicAppConfig->appName, '\0', sizeof(pDynamicAppConfig->appName)); strncpy (pDynamicAppConfig->appName, itrName.c_str(), sizeof(pDynamicAppConfig->appName) - 1); + pDynamicAppConfig->appName[sizeof(pDynamicAppConfig->appName) - 1] = '\0'; memset (pDynamicAppConfig->prefixes, '\0', sizeof(pDynamicAppConfig->prefixes)); memset (pDynamicAppConfig->cors, '\0', sizeof(pDynamicAppConfig->cors)); memset (pDynamicAppConfig->query, '\0', sizeof(pDynamicAppConfig->query)); @@ -820,6 +821,7 @@ void XCast::updateDynamicAppCache(JsonArray applications) LOGINFO("%s, size:%d", itrPrefix.c_str(), (int)strlen (itrPrefix.c_str())); for (DynamicAppConfig* pDynamicAppConfig : appConfigListTemp) { strncpy (pDynamicAppConfig->prefixes, itrPrefix.c_str(), sizeof(pDynamicAppConfig->prefixes) - 1); + pDynamicAppConfig->prefixes[sizeof(pDynamicAppConfig->prefixes) - 1] = '\0'; } } } @@ -835,6 +837,7 @@ void XCast::updateDynamicAppCache(JsonArray applications) LOGINFO("%s, size:%d", itrCor.c_str(), (int)strlen (itrCor.c_str())); for (DynamicAppConfig* pDynamicAppConfig : appConfigListTemp) { strncpy (pDynamicAppConfig->cors, itrCor.c_str(), sizeof(pDynamicAppConfig->cors) - 1); + pDynamicAppConfig->cors[sizeof(pDynamicAppConfig->cors) - 1] = '\0'; } } } @@ -887,9 +890,11 @@ void XCast::updateDynamicAppCache(JsonArray applications) for (DynamicAppConfig* pDynamicAppConfig : appConfigListTemp) { if (jLaunchParam.HasLabel("query")) { strncpy (pDynamicAppConfig->query, jQuery.c_str(), sizeof(pDynamicAppConfig->query) - 1); + pDynamicAppConfig->query[sizeof(pDynamicAppConfig->query) - 1] = '\0'; } if (jLaunchParam.HasLabel("payload")) { strncpy (pDynamicAppConfig->payload, jPayload.c_str(), sizeof(pDynamicAppConfig->payload) - 1); + pDynamicAppConfig->payload[sizeof(pDynamicAppConfig->payload) - 1] = '\0'; } } @@ -1090,29 +1095,36 @@ void XCast::getUrlFromAppLaunchParams (const char *app_name, const char *payload int has_query = query_string && strlen(query_string); int has_payload = 0; if (has_query) { - strcat(url, query_string); + snprintf(url + strlen(url), url_len, "%s", query_string); url_len -= strlen(query_string); } if(payload && strlen(payload)) { - if (has_query) url_len -=1; //for & const char payload_key[] = "dialpayload="; - url_len -= sizeof(payload_key) - 1; - url_len -= strlen(payload); if(url_len >= 0){ - if (has_query) strcat(url, "&"); - strcat(url, payload_key); - strcat(url, payload); - has_payload = 1; + if (has_query) { + snprintf(url + strlen(url), url_len, "%s", "&"); + url_len -= 1; + } + if(url_len >= 0) { + snprintf(url + strlen(url), url_len, "%s%s", payload_key, payload); + url_len -= strlen(payload_key) + strlen(payload); + has_payload = 1; + } } else { - LOGINFO("there is no enough room for payload\r\n"); + LOGINFO("there is not enough room for payload\r\n"); } } - - if(additional_data_url != NULL){ - if (has_query || has_payload) strcat(url, "&"); - strcat(url, "additionalDataUrl="); - strcat(url, additional_data_url); + + if(additional_data_url != NULL){ + if ((has_query || has_payload) && url_len >= 0) { + snprintf(url + strlen(url), url_len, "%s", "&"); + url_len -= 1; + } + if (url_len >= 0) { + snprintf(url + strlen(url), url_len, "additionalDataUrl=%s", additional_data_url); + url_len -= strlen(additional_data_url) + 18; + } } LOGINFO(" url is [%s]\r\n", url); } diff --git a/cmake/FindIARMBus.cmake b/cmake/FindIARMBus.cmake index cad92b7305..7d32a1ba0a 100644 --- a/cmake/FindIARMBus.cmake +++ b/cmake/FindIARMBus.cmake @@ -27,13 +27,12 @@ find_package(PkgConfig) find_library(IARMBUS_LIBRARIES NAMES IARMBus) find_path(IARMBUS_INCLUDE_DIRS NAMES libIARM.h PATH_SUFFIXES rdk/iarmbus) -find_path(IARMIR_INCLUDE_DIRS NAMES irMgr.h PATH_SUFFIXES rdk/iarmmgrs/ir) find_path(IARMRECEIVER_INCLUDE_DIRS NAMES receiverMgr.h PATH_SUFFIXES rdk/iarmmgrs/receiver) find_path(IARMPWR_INCLUDE_DIRS NAMES pwrMgr.h PATH_SUFFIXES rdk/iarmmgrs-hal) set(IARMBUS_LIBRARIES ${IARMBUS_LIBRARIES} CACHE PATH "Path to IARMBus library") -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) -set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMIR_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS}) +set(IARMBUS_INCLUDE_DIRS ${IARMBUS_INCLUDE_DIRS} ${IARMRECEIVER_INCLUDE_DIRS} ${IARMPWR_INCLUDE_DIRS} CACHE PATH "Path to IARMBus include") include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(IARMBUS DEFAULT_MSG IARMBUS_INCLUDE_DIRS IARMBUS_LIBRARIES) diff --git a/l1tests.cmake b/l1tests.cmake index a6aa62b603..585fa5667e 100755 --- a/l1tests.cmake +++ b/l1tests.cmake @@ -100,7 +100,6 @@ set(EMPTY_HEADERS ${BASEDIR}/rtNotifier.h ${BASEDIR}/dsRpc.h ${BASEDIR}/websocket/URL.h - ${BASEDIR}/rdk/iarmmgrs/irMgr.h ${BASEDIR}/rdk/iarmmgrs/comcastIrKeyCodes.h ${BASEDIR}/rdk_logger_milestone.h ${BASEDIR}/opkg/opkg.h