From 158ba0140907019e8fb67087b7f2b109334d9894 Mon Sep 17 00:00:00 2001 From: wuchengwen Date: Sat, 6 Sep 2025 15:09:30 +0800 Subject: [PATCH] fix:The length limit of the string is too short Signed-off-by: wuchengwen --- frameworks/js/napi/inputmethodclient/js_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/js/napi/inputmethodclient/js_utils.cpp b/frameworks/js/napi/inputmethodclient/js_utils.cpp index eb1c266ef..a14d0880d 100644 --- a/frameworks/js/napi/inputmethodclient/js_utils.cpp +++ b/frameworks/js/napi/inputmethodclient/js_utils.cpp @@ -19,7 +19,7 @@ namespace OHOS { namespace MiscServices { -constexpr int32_t STR_MAX_LENGTH = 4096; +constexpr int32_t STR_MAX_LENGTH = 1024 * 1024 * 128; // 128MB constexpr size_t STR_TAIL_LENGTH = 1; constexpr size_t ARGC_MAX = 6; constexpr size_t ARGC_ONE = 1; @@ -291,7 +291,7 @@ napi_status JsUtils::GetValue(napi_env env, napi_value in, std::string &out) } if (maxLen > STR_MAX_LENGTH) { - IMSA_HILOGE("string length is too long."); + IMSA_HILOGE("string length is too long, maxLen: %{public}zu.", maxLen); return napi_generic_failure; } IMSA_HILOGD("napi_value -> std::string get length %{public}zu", maxLen); -- Gitee