Changeset 245249 in webkit
- Timestamp:
- May 13, 2019 1:52:04 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r245203 r245249 1 2019-05-13 Tadeu Zagallo <tzagallo@apple.com> 2 3 JSObject::getOwnPropertyDescriptor is missing an exception check 4 https://bugs.webkit.org/show_bug.cgi?id=197693 5 <rdar://problem/50441784> 6 7 Reviewed by Saam Barati. 8 9 * stress/proxy-spread.js: Added. 10 (foo): 11 1 12 2019-05-10 Saam barati <sbarati@apple.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r245239 r245249 1 2019-05-13 Tadeu Zagallo <tzagallo@apple.com> 2 3 JSObject::getOwnPropertyDescriptor is missing an exception check 4 https://bugs.webkit.org/show_bug.cgi?id=197693 5 <rdar://problem/50441784> 6 7 Reviewed by Saam Barati. 8 9 The method table call to getOwnPropertySlot might throw, and JSObject::getOwnPropertyDescriptor 10 must handle the exception before calling PropertySlot::getValue, which can also throw. 11 12 * runtime/JSObject.cpp: 13 (JSC::JSObject::getOwnPropertyDescriptor): 14 1 15 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com> 2 16 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r244872 r245249 3442 3442 { 3443 3443 VM& vm = exec->vm(); 3444 auto scope = DECLARE_THROW_SCOPE(vm); 3444 3445 JSC::PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty); 3445 if (!methodTable(vm)->getOwnPropertySlot(this, exec, propertyName, slot)) 3446 3447 bool result = methodTable(vm)->getOwnPropertySlot(this, exec, propertyName, slot); 3448 EXCEPTION_ASSERT(!scope.exception() || !result); 3449 if (!result) 3446 3450 return false; 3447 3451 … … 3489 3493 if (getterSetter->setter()) 3490 3494 descriptor.setSetter(getCustomGetterSetterFunctionForGetterSetter(exec, propertyName, getterSetter, JSCustomGetterSetterFunction::Type::Setter)); 3491 } else 3492 descriptor.setDescriptor(slot.getValue(exec, propertyName), slot.attributes()); 3495 } else { 3496 JSValue value = slot.getValue(exec, propertyName); 3497 RETURN_IF_EXCEPTION(scope, false); 3498 descriptor.setDescriptor(value, slot.attributes()); 3499 } 3500 3493 3501 return true; 3494 3502 } -
trunk/Source/WebCore/ChangeLog
r245242 r245249 1 2019-05-13 Tadeu Zagallo <tzagallo@apple.com> 2 3 JSObject::getOwnPropertyDescriptor is missing an exception check 4 https://bugs.webkit.org/show_bug.cgi?id=197693 5 6 Reviewed by Saam Barati. 7 8 JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false 9 if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon. 10 11 This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html 12 13 * bindings/js/JSLocationCustom.cpp: 14 (WebCore::getOwnPropertySlotCommon): 15 (WebCore::JSLocation::getOwnPropertySlot): 16 (WebCore::JSLocation::getOwnPropertySlotByIndex): 17 1 18 2019-05-13 Antti Koivisto <antti@apple.com> 2 19 -
trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp
r241104 r245249 74 74 throwSecurityError(state, scope, message); 75 75 slot.setUndefined(); 76 return true;76 return false; 77 77 } 78 78 79 79 bool JSLocation::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot) 80 80 { 81 VM& vm = state->vm(); 82 auto scope = DECLARE_THROW_SCOPE(vm); 81 83 auto* thisObject = jsCast<JSLocation*>(object); 82 84 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 83 85 84 if (getOwnPropertySlotCommon(*thisObject, *state, propertyName, slot)) 85 return true; 86 return JSObject::getOwnPropertySlot(object, state, propertyName, slot); 86 bool result = getOwnPropertySlotCommon(*thisObject, *state, propertyName, slot); 87 EXCEPTION_ASSERT(!scope.exception() || !result); 88 RETURN_IF_EXCEPTION(scope, false); 89 if (result) 90 return true; 91 RELEASE_AND_RETURN(scope, JSObject::getOwnPropertySlot(object, state, propertyName, slot)); 87 92 } 88 93 89 94 bool JSLocation::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot) 90 95 { 96 VM& vm = state->vm(); 97 auto scope = DECLARE_THROW_SCOPE(vm); 91 98 auto* thisObject = jsCast<JSLocation*>(object); 92 99 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 93 100 94 if (getOwnPropertySlotCommon(*thisObject, *state, Identifier::from(state, index), slot)) 95 return true; 96 return JSObject::getOwnPropertySlotByIndex(object, state, index, slot); 101 bool result = getOwnPropertySlotCommon(*thisObject, *state, Identifier::from(state, index), slot); 102 EXCEPTION_ASSERT(!scope.exception() || !result); 103 RETURN_IF_EXCEPTION(scope, false); 104 if (result) 105 return true; 106 RELEASE_AND_RETURN(scope, JSObject::getOwnPropertySlotByIndex(object, state, index, slot)); 97 107 } 98 108
Note: See TracChangeset
for help on using the changeset viewer.