diff --git a/include/codec_config/syscap_define.h b/include/codec_config/syscap_define.h index be54e8252c0ba21c8e8ebf78867b89f41c99b376..aa8026a12004e25f9cf781a3d654ac752f47cef0 100644 --- a/include/codec_config/syscap_define.h +++ b/include/codec_config/syscap_define.h @@ -379,6 +379,8 @@ typedef enum SystemCapabilityNum { DISTRIBUTEDSCHED_APPCOLLABORATION, MULTIMEDIA_AVSESSION_AVINPUTCAST, GAME_GAMECONTROLLER, + DISTRIBUTEDDATAMANAGER_DATAINTELLIGENCE_CORE, + MULTIMODALAWARENESS_DEVICESTATUS, // Add before here SYSCAP_BASIC_END = 500, } SyscapNum; @@ -742,6 +744,8 @@ const static SyscapWithNum g_arraySyscap[] = { {"SystemCapability.MultimodalAwarness.Motion", MULTIMODALAWARENESS_MOTION}, {"SystemCapability.DistributedSched.AppCollaboration", DISTRIBUTEDSCHED_APPCOLLABORATION}, {"SystemCapability.Game.GameController", GAME_GAMECONTROLLER}, + {"SystemCapability.DistributedDataManager.DataIntelligence.Core", DISTRIBUTEDDATAMANAGER_DATAINTELLIGENCE_CORE}, + {"SystemCapability.MultimodalAwareness.DeviceStatus", MULTIMODALAWARENESS_DEVICESTATUS}, }; #ifdef __cplusplus diff --git a/src/create_pcid.c b/src/create_pcid.c index da299fe77dc9004582e5ae4320bc7a3338b4f379..1b08215bc22b6d05260ac2ba526223c29de62bab 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -379,6 +379,11 @@ static int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t con char *tempPriSyscapStr = priSyscapStr; char *ptrPrivateSyscap = (char *)(pcidMain + 1); while (*ptrPrivateSyscap != '\0') { + size_t currentLen = tempPriSyscapStr - priSyscapStr; + if (currentLen >= SINGLE_SYSCAP_LEN - 1) { + printf("Syscap name exceeds maximum length\n"); + return GetPriSyscapResult(capVectorPtr, -1); + } if (*ptrPrivateSyscap == ',') { *tempPriSyscapStr = '\0'; int32_t ret = sprintf_s(fullCapStr, SINGLE_SYSCAP_LEN, "SystemCapability.%s", priSyscapStr);