Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a8daa1741f67d91cfe554dcd62019946165db6fb
      
https://github.com/WebKit/WebKit/commit/a8daa1741f67d91cfe554dcd62019946165db6fb
  Author: Elijah Sawyers <[email protected]>
  Date:   2025-10-08 (Wed, 08 Oct 2025)

  Changed paths:
    M 
Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIDeclarativeNetRequest.cpp
    M 
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIDeclarativeNetRequest.mm

  Log Message:
  -----------
  Crash in WebKit: 
WebKit::WebExtensionContext::declarativeNetRequestUpdateDynamicRules
https://bugs.webkit.org/show_bug.cgi?id=300330
rdar://161999838

Reviewed by Brian Weinstein and Timothy Hatcher.

This patch fixes a crash when updating dynamic or session rules with an empty 
addRules key. To fix
this, we just need to check that the string is not empty prior to trying to 
parse it as a JSON
array.

Wrote a new test to validate the fix.

Test: 
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIDeclarativeNetRequest.mm
* 
Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIDeclarativeNetRequest.cpp:
(WebKit::WebExtensionContext::declarativeNetRequestUpdateDynamicRules):
(WebKit::WebExtensionContext::declarativeNetRequestUpdateSessionRules):
* 
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIDeclarativeNetRequest.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPIDeclarativeNetRequest, 
RemoveSessionRules)):
(TestWebKitAPI::TEST(WKWebExtensionAPIDeclarativeNetRequest, 
RemoveDynamicRules)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to