Bug 213681

Summary: Fix missing exception check in createIDBKeyFromValue().
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: WebCore Misc.Assignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, beidson, cdumez, ews-watchlist, ggaren, jsbell, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch.
mark.lam: review-
proposed patch.
cdumez: review+
patch for landing. none

Description Mark Lam 2020-06-27 10:04:15 PDT
<rdar://problem/64804893>
Comment 1 Mark Lam 2020-06-27 10:11:46 PDT
Created attachment 402962 [details]
proposed patch.
Comment 2 Mark Lam 2020-06-27 10:15:45 PDT
Comment on attachment 402962 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402962&action=review

> Source/WebCore/bridge/objc/WebScriptObject.mm:286
> +    bool isSafe =  BindingSecurity::shouldAllowAccessToDOMWindow(_private->originRootObject->globalObject(), target->wrapped());

Will remove extra space.
Comment 3 Mark Lam 2020-06-27 10:27:06 PDT
Created attachment 402963 [details]
proposed patch.
Comment 4 Chris Dumez 2020-06-27 10:42:56 PDT
Comment on attachment 402963 [details]
proposed patch.

r=me if the bots are happy
Comment 5 Mark Lam 2020-06-27 10:57:05 PDT
Comment on attachment 402963 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402963&action=review

> Source/WebCore/bridge/objc/WebScriptObject.mm:287
> +    bool isSafe = BindingSecurity::shouldAllowAccessToDOMWindow(_private->originRootObject->globalObject(), target->wrapped());
> +    CLEAR_AND_RETURN_IF_EXCEPTION(scope, false);

This call to BindingSecurity::shouldAllowAccessToDOMWindow() will never throw because it uses a default argument SecurityReportingOption = LogSecurityError.  I'll change this CLEAR_AND_RETURN_IF_EXCEPTION to an EXCEPTION_ASSERT_UNUSED to assert that no exception is thrown.
Comment 6 Mark Lam 2020-06-27 11:02:35 PDT
Created attachment 402966 [details]
patch for landing.

Thanks for the review.
Comment 7 EWS 2020-06-27 15:14:09 PDT
Committed r263628: <https://trac.webkit.org/changeset/263628>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402966 [details].