From 7a691e9262edf0bc6a2f78d047a13da807a5ccac Mon Sep 17 00:00:00 2001 From: lukai Date: Sat, 23 Jul 2022 14:57:10 +0800 Subject: [PATCH] utilxts bugfix issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5IJY3?from=project-issue 1. u_getDataDirectory() is not thread-safe.It should be called at most once in a process 2. buffer write overflow Signed-off-by: lukai --- util/js_base64.cpp | 2 -- util/js_textdecoder.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/util/js_base64.cpp b/util/js_base64.cpp index 5443144..70ef655 100755 --- a/util/js_base64.cpp +++ b/util/js_base64.cpp @@ -456,8 +456,6 @@ namespace OHOS::Util { inputDecode = static_cast(resultData) + byteOffset; CreateDecodePromise(env, inputDecode, length); } - delete[] inputString; - inputString = nullptr; return stdDecodeInfo_->promise; } void Base64::CreateDecodePromise(napi_env env, char *inputDecode, size_t length) diff --git a/util/js_textdecoder.cpp b/util/js_textdecoder.cpp index 6bb026d..2ef93df 100755 --- a/util/js_textdecoder.cpp +++ b/util/js_textdecoder.cpp @@ -42,7 +42,6 @@ namespace OHOS::Util { } } label_ = i32Flag; - SetHwIcuDirectory(); bool fatal = (i32Flag & static_cast(ConverterFlags::FATAL_FLG)) == static_cast(ConverterFlags::FATAL_FLG);