update src/create_pcid.c.

Signed-off-by: 严学舟 <yangang20@huawei.com>
This commit is contained in:
严学舟
2024-08-08 02:51:21 +00:00
committed by Gitee
parent ac5122f95a
commit fe0744cbc1
+2 -2
View File
@@ -358,7 +358,7 @@ static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret)
return ret;
}
int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, uint32_t contextBufLen)
int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t contextBufLen)
{
cJSON *capVectorPtr = cJSON_CreateArray();
if (capVectorPtr == NULL) {
@@ -366,7 +366,7 @@ int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, uint32_t contextBu
return -1;
}
int32_t privateSyscapLen = (int32_t)(contextBufLen - sizeof(PCIDMain) - 1);
int32_t privateSyscapLen = contextBufLen - sizeof(PCIDMain) - 1;
if (privateSyscapLen < 0 || privateSyscapLen > INT32_MAX) {
PRINT_ERR("parse private syscap failed.");
return GetPriSyscapResult(capVectorPtr, -1);