From 8451e7306989e61ad8b496d5fb9bec2eaff106b8 Mon Sep 17 00:00:00 2001 From: tianp Date: Mon, 8 Sep 2025 12:19:18 +0800 Subject: [PATCH] =?UTF-8?q?memcpy=5Fs=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianp Change-Id: I9e571518c0a0f1bd1f4f63c52d658845d8ab13de --- interfaces/kits/js/src/common/ani_helper/type_converter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/kits/js/src/common/ani_helper/type_converter.cpp b/interfaces/kits/js/src/common/ani_helper/type_converter.cpp index d034d29d7..adc67a16b 100644 --- a/interfaces/kits/js/src/common/ani_helper/type_converter.cpp +++ b/interfaces/kits/js/src/common/ani_helper/type_converter.cpp @@ -254,11 +254,11 @@ std::tuple TypeConverter::ToAniArrayBuffer(ani_env *env, void *buf = nullptr; ani_size len = 0; - if ((ANI_OK != env->ArrayBuffer_GetInfo(static_cast(obj), &buf, &len)) && (!buf)) { + if ((ANI_OK != env->ArrayBuffer_GetInfo(static_cast(obj), &buf, &len)) || (!buf)) { return { false, nullptr }; } - int res = memcpy_s(buf, length, buffer, length); + int res = memcpy_s(buf, len, buffer, length); if (res != 0) { return { false, nullptr }; } -- Gitee