From a806aace4e0c7dfca0e83a0f559f270c5f1d4111 Mon Sep 17 00:00:00 2001 From: yangbiao59 Date: Tue, 5 Aug 2025 10:05:46 +0000 Subject: [PATCH] =?UTF-8?q?read=5Fcore.cpp=E4=B8=ADValidReadArg=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangbiao59 --- interfaces/kits/js/src/mod_fs/properties/read_core.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interfaces/kits/js/src/mod_fs/properties/read_core.cpp b/interfaces/kits/js/src/mod_fs/properties/read_core.cpp index 2099ebce6..1c4ac55b9 100644 --- a/interfaces/kits/js/src/mod_fs/properties/read_core.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/read_core.cpp @@ -34,12 +34,13 @@ static tuple ValidReadArg(ArrayBuffer &arrayBuffe int64_t offset = -1; bool succ = false; void *buf = arrayBuffer.buf; - size_t bufLen = arrayBuffer.length; + size_t bufLen = arrayBuffer.length; if (bufLen > UINT_MAX) { HILOGE("Invalid arraybuffer"); return { false, nullptr, retLen, offset }; } + optional lengthOp = nullopt; optional offsetOp = nullopt; if (options.has_value()) { -- Gitee