mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-27 00:20:44 +00:00
commit
ab8251468e
@ -33,6 +33,7 @@ constexpr int32_t ERR_NOT_OK = -1;
|
|||||||
constexpr int32_t ARG_COUNT_ONE = 1;
|
constexpr int32_t ARG_COUNT_ONE = 1;
|
||||||
constexpr int32_t ARG_COUNT_TWO = 2;
|
constexpr int32_t ARG_COUNT_TWO = 2;
|
||||||
constexpr int32_t ARG_COUNT_THREE = 3;
|
constexpr int32_t ARG_COUNT_THREE = 3;
|
||||||
|
constexpr uint32_t MAX_JSPROCOUNT = 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsContinuationManager::Finalizer(NativeEngine* engine, void* data, void* hint)
|
void JsContinuationManager::Finalizer(NativeEngine* engine, void* data, void* hint)
|
||||||
@ -490,6 +491,10 @@ bool JsContinuationManager::PraseJson(const napi_env& env, const napi_value& jso
|
|||||||
napi_value jsProName = nullptr;
|
napi_value jsProName = nullptr;
|
||||||
napi_value jsProValue = nullptr;
|
napi_value jsProValue = nullptr;
|
||||||
napi_valuetype jsValueType = napi_undefined;
|
napi_valuetype jsValueType = napi_undefined;
|
||||||
|
if (jsProCount > MAX_JSPROCOUNT) {
|
||||||
|
HILOGE("value of jsProCount is larger than MAX_JSPROCOUNT");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for (uint32_t index = 0; index < jsProCount; index++) {
|
for (uint32_t index = 0; index < jsProCount; index++) {
|
||||||
napi_get_element(env, jsProNameList, index, &jsProName);
|
napi_get_element(env, jsProNameList, index, &jsProName);
|
||||||
std::string strProName = UnwrapStringFromJS(env, jsProName);
|
std::string strProName = UnwrapStringFromJS(env, jsProName);
|
||||||
|
Loading…
Reference in New Issue
Block a user