mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 02:11:19 -04:00
!540 处理堆栈溢出问题
Merge pull request !540 from Mr.zhao/OpenHarmony-5.0.3-Release
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user