create_pcid.c 缓冲区越界读写 修复

Signed-off-by: cuican <cuican23@h-partners.com>
This commit is contained in:
cuican
2026-06-09 17:32:41 +08:00
parent 9bf113a6d7
commit e7abae814c
+1 -1
View File
@@ -909,7 +909,7 @@ int32_t EncodePcidscToString(char *inputFile, char *outDirPath)
if (priSyscapCount == 0) {
return GetEncodePCIDOut(priSyscapCount, privateSyscapLen, mainSyscap, freePcidInfo, ret);
}
freePcidInfo.priSyscapFull = (char *)malloc(priSyscapCount * SINGLE_SYSCAP_LEN);
freePcidInfo.priSyscapFull = (char *)malloc((priSyscapCount + 1) * SINGLE_SYSCAP_LEN);
if (freePcidInfo.priSyscapFull == NULL) {
PRINT_ERR("malloc failed\n");
return FreeAfterEncodePCID(freePcidInfo, FREE_ENCODE_PCID_CONTEXT_OUT, ret);