From 55657220adad87d4e20a304d96aa89658d97fa7b Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Sat, 3 Aug 2024 09:28:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?#IAHKVH=20=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=9C=89=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E6=95=B4=E6=95=B0=E8=BF=90=E7=AE=97=E4=B8=8D=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- src/create_pcid.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 4972ac9..0549f05 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -358,7 +358,7 @@ static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret) return ret; } -int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, size_t contextBufLen) +int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, uint32_t contextBufLen) { cJSON *capVectorPtr = cJSON_CreateArray(); if (capVectorPtr == NULL) { @@ -366,11 +366,6 @@ int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, size_t contextBufL return -1; } - if (contextBufLen > UINT32_MAX) { - PRINT_ERR("the data privateSyscapLen is out of scope."); - return GetPriSyscapResult(capVectorPtr, -1); - } - int32_t privateSyscapLen = (int32_t)(contextBufLen - sizeof(PCIDMain) - 1); if (privateSyscapLen < 0 || privateSyscapLen > INT32_MAX) { PRINT_ERR("parse private syscap failed."); -- Gitee From 91d373c62c91b9b256ef603dfec8c33ce41b457d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=AD=A6=E8=88=9F?= Date: Thu, 8 Aug 2024 02:51:21 +0000 Subject: [PATCH 2/3] update src/create_pcid.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 严学舟 --- src/create_pcid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 0549f05..c346a43 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -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); -- Gitee From 5154aa66ae98171109ff3487683e2503b47ac1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=AD=A6=E8=88=9F?= Date: Thu, 8 Aug 2024 07:56:09 +0000 Subject: [PATCH 3/3] update src/create_pcid.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 严学舟 --- src/create_pcid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index c346a43..ad3755c 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -358,7 +358,7 @@ static int32_t GetPriSyscapResult(cJSON *capVectorPtr, int32_t ret) return ret; } -int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t contextBufLen) +static int32_t GetPriSyscap(PCIDMain *pcidMain, cJSON *sysCapObject, int32_t contextBufLen) { cJSON *capVectorPtr = cJSON_CreateArray(); if (capVectorPtr == NULL) { -- Gitee