mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 02:11:19 -04:00
create_pcid.c 缓冲区越界读写 修复
Signed-off-by: cuican <cuican23@h-partners.com>
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user