IPC warning

Signed-off-by: LiYimeng <liyimeng2@huawei.com>
This commit is contained in:
LiYimeng
2026-07-29 10:04:05 +08:00
parent 24576a56e8
commit 209986ed33
3 changed files with 9 additions and 5 deletions
@@ -247,7 +247,7 @@ napi_status NapiUtils::GetValue(napi_env env, napi_value in, std::string& out)
size_t len = 0;
status = napi_get_value_string_utf8(env, in, buf, maxLen + STR_TAIL_LENGTH, &len);
if (status == napi_ok) {
out = std::string(buf);
out = std::string(buf, len);
}
return status;
}
@@ -1090,6 +1090,7 @@ napi_status NapiUtils::GetValueEx(napi_env env, napi_value in, std::vector<int32
bool isTypedArray = false;
napi_status status = napi_is_typedarray(env, in, &isTypedArray);
SLOGD("GetValueEx int32_t input %{public}s a TypedArray", isTypedArray ? "is" : "is not");
CHECK_RETURN(status == napi_ok, "napi_is_typedarray failed!", status);
if (isTypedArray) {
napi_typedarray_type type = napi_biguint64_array;
@@ -2015,7 +2016,8 @@ napi_status NapiUtils::GetValue(napi_env env, napi_value in, DeviceInfo& out)
CHECK_RETURN(status == napi_ok, "get DeviceInfo deviceType_ failed", status);
status = GetValue(env, value, out.deviceType_);
CHECK_RETURN(status == napi_ok, "get DeviceInfo deviceType_ value failed", status);
CHECK_RETURN(GetOptionalString(env, in, out) == napi_ok, "get DeviceInfo ip address value failed", status);
status = GetOptionalString(env, in, out);
CHECK_RETURN(status == napi_ok, "get DeviceInfo ip address value failed", status);
bool hasKey = false;
napi_has_named_property(env, in, "providerId", &hasKey);
@@ -2363,7 +2365,8 @@ napi_status NapiUtils::SetValue(
napi_value entry = nullptr;
status = NapiAVSessionController::NewInstance(env, item, entry);
CHECK_RETURN((status == napi_ok), "controller newInstance failed!", status);
napi_set_element(env, out, index++, entry);
status = napi_set_element(env, out, index++, entry);
CHECK_RETURN((status == napi_ok), "napi_set_element failed!", status);
}
return status;
}
+1 -1
View File
@@ -992,7 +992,7 @@ void AVSessionImpl::SetBackgroundPlayModeSync(BackgroundPlayMode mode)
if (!mode.is_valid()) {
TaiheUtils::ThrowError(TaiheAVSessionManager::errcode_[OHOS::AVSession::ERR_INVALID_PARAM],
"SetBackgroundPlayMode failed : session is nullptr");
"SetBackgroundPlayMode failed : invalid background play mode");
return;
}
+2 -1
View File
@@ -462,7 +462,8 @@ public:
const size_t total_length = networkId.length();
int PREFIX_LENGTH = 4;
int SUFFIX_LENGTH = 4;
CHECK_AND_RETURN_RET(total_length >= static_cast<size_t>(PREFIX_LENGTH + SUFFIX_LENGTH), networkId);
CHECK_AND_RETURN_RET(total_length >= static_cast<size_t>(PREFIX_LENGTH + SUFFIX_LENGTH),
std::string(total_length, '*'));
std::string result;
result.reserve(total_length);