From 6c5c47aa00f8ce72856b7ed28963dc2a61cbb7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E8=BE=B0=E8=BE=B0=E5=91=A2?= Date: Wed, 10 Jan 2024 10:33:42 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9memcpy=5Fs=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 我辰辰呢 --- test/fuzztest/key/dhkeyutil_fuzzer/dhkeyutil_fuzzer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/fuzztest/key/dhkeyutil_fuzzer/dhkeyutil_fuzzer.cpp b/test/fuzztest/key/dhkeyutil_fuzzer/dhkeyutil_fuzzer.cpp index dcd09f1..e367c34 100644 --- a/test/fuzztest/key/dhkeyutil_fuzzer/dhkeyutil_fuzzer.cpp +++ b/test/fuzztest/key/dhkeyutil_fuzzer/dhkeyutil_fuzzer.cpp @@ -50,7 +50,8 @@ namespace OHOS { } HcfDhCommParamsSpec *returnCommonParamSpec = nullptr; int32_t pLen = 0; - (void)memcpy_s(&pLen, sizeof(int32_t), data, sizeof(int32_t)); + const int32_t int32Size = sizeof(int32_t); + (void)memcpy_s(&pLen, int32Size, data, int32Size); HcfResult res = HcfDhKeyUtilCreate(pLen, 0, &returnCommonParamSpec); if (res != HCF_SUCCESS) { return false;