Bug 231758 - Null check the context in -[WKWebProcessPlugInFrame jsContextForServiceWorkerWorld:]
Summary: Null check the context in -[WKWebProcessPlugInFrame jsContextForServiceWorker...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-14 12:33 PDT by Timothy Hatcher
Modified: 2021-10-14 13:42 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.80 KB, patch)
2021-10-14 12:37 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff
Patch (1.79 KB, patch)
2021-10-14 12:40 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2021-10-14 12:33:19 PDT
_frame->jsContextForServiceWorkerWorld() can return nullptr, so we should null check before using the result.
Comment 1 Timothy Hatcher 2021-10-14 12:37:45 PDT
Created attachment 441257 [details]
Patch
Comment 2 Chris Dumez 2021-10-14 12:38:25 PDT
Comment on attachment 441257 [details]
Patch

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

> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:76
> +    if (JSGlobalContextRef context = _frame->jsContextForServiceWorkerWorld(&[world _scriptWorld]))

auto
Comment 3 Timothy Hatcher 2021-10-14 12:40:57 PDT
Created attachment 441259 [details]
Patch
Comment 4 EWS 2021-10-14 13:41:21 PDT
Committed r284195 (243009@main): <https://commits.webkit.org/243009@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441259 [details].
Comment 5 Radar WebKit Bug Importer 2021-10-14 13:42:18 PDT
<rdar://problem/84272222>