!865 Fix security warning

Merge pull request !865 from diartyz/sync
This commit is contained in:
openharmony_ci 2024-09-07 18:42:19 +00:00 committed by Gitee
commit 9b39bb1dd5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -677,13 +677,13 @@ void RuntimeImpl::GetSendableSetValue(Local<JSValueRef> value,
std::vector<std::unique_ptr<PropertyDescriptor>> *outPropertyDesc)
{
Local<SendableSetRef> setRef = value->ToObject(vm_);
int32_t size = setRef->GetSize(vm_);
int32_t len = setRef->GetTotalElements(vm_);
uint32_t size = setRef->GetSize(vm_);
uint32_t len = setRef->GetTotalElements(vm_);
int32_t index = 0;
Local<JSValueRef> jsValueRef = NumberRef::New(vm_, size);
SetKeyValue(jsValueRef, outPropertyDesc, "size");
jsValueRef = ArrayRef::New(vm_, size);
for (int32_t i = 0; i < len; ++i) {
for (uint32_t i = 0; i < len; ++i) {
Local<JSValueRef> elementRef = setRef->GetValue(vm_, i);
if (elementRef->IsHole()) {
continue;