Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 65057afee9f465159d8227d52d16d62c2c255d54
      
https://github.com/WebKit/WebKit/commit/65057afee9f465159d8227d52d16d62c2c255d54
  Author: Vitaly Dyachkov <[email protected]>
  Date:   2026-01-26 (Mon, 26 Jan 2026)

  Changed paths:
    M Source/WebCore/Modules/web-locks/WebLockManager.cpp
    M Source/WebCore/bindings/js/JSDOMPromise.cpp

  Log Message:
  -----------
  Fix crash in `DOMPromise::whenPromiseIsSettled` during worker termination
https://bugs.webkit.org/show_bug.cgi?id=305762

Reviewed by Youenn Fablet.

`DOMPromise::whenPromiseIsSettled()` could crash when called during
worker shutdown due to two issues:

1. The `waitingPromise` in `WebLockManager::didCompleteLockRequest()`
   could be suspended during worker termination, leading to invalid
   access when the promise settled handler was invoked.

2. `JSBoundFunction::create()` can return `nullptr` in some cases, but
   the result was passed directly to `performPromiseThen()` without
   validation.

This patch adds necessary checks to prevent crashes in these scenarios.

* Source/WebCore/Modules/web-locks/WebLockManager.cpp:
(WebCore::WebLockManager::didCompleteLockRequest):
* Source/WebCore/bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):

Canonical link: https://commits.webkit.org/306190@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to