Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f5e47e092767eeb0b5168de1ba58899a0162222a
      
https://github.com/WebKit/WebKit/commit/f5e47e092767eeb0b5168de1ba58899a0162222a
  Author: Roberto Rodriguez <[email protected]>
  Date:   2025-10-25 (Sat, 25 Oct 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/fast/url/url-pattern-very-large-string-expected.txt
    A LayoutTests/fast/url/url-pattern-very-large-string.html
    M Source/WebCore/Modules/url-pattern/URLPatternTokenizer.cpp
    M Source/WebCore/Modules/url-pattern/URLPatternTokenizer.h

  Log Message:
  -----------
  Handle very large url pattern input
https://bugs.webkit.org/show_bug.cgi?id=301302
rdar://163099884

Reviewed by Ryosuke Niwa and Matthieu Dubet.

When creating a URLPattern with a string as an input, it is possible to
create it with a string so large that the underlying token list (vector)
will intentionally crash when performing an append operation and the
capacity cannot be increased. Check the result of each token append
operation and throw an exception if an append cannot be performed.

Test: fast/dom/DOMURL/url-pattern-very-large-string.html

* LayoutTests/fast/dom/DOMURL/url-pattern-very-large-string-expected.txt: Added.
* LayoutTests/fast/dom/DOMURL/url-pattern-very-large-string.html: Added.
* Source/WebCore/Modules/url-pattern/URLPatternTokenizer.cpp:
(WebCore::URLPatternUtilities::Tokenizer::addToken):
(WebCore::URLPatternUtilities::Tokenizer::tokenize):
* Source/WebCore/Modules/url-pattern/URLPatternTokenizer.h:

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



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

Reply via email to