Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e3c1c1295f4a6af842514d78eed4a1f92df2c0aa
https://github.com/WebKit/WebKit/commit/e3c1c1295f4a6af842514d78eed4a1f92df2c0aa
Author: Anand Srinivasan <[email protected]>
Date: 2026-03-02 (Mon, 02 Mar 2026)
Changed paths:
A JSTests/stress/string-regexp-replace-oom.js
M Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Log Message:
-----------
Gracefully handle StringBuffer overflow in RegExp replace operator
https://bugs.webkit.org/show_bug.cgi?id=308836
rdar://171058069
Reviewed by Marcus Plutowski.
When the RegExp replace operator is called, if the output string
overflows the maximum legal length of a javascript string it is
supposed to throw an out-of-memory error, rather than triggering a
controlled crash.
Test: JSTests/stress/string-regexp-replace-oom.js
* JSTests/stress/string-regexp-replace-oom.js: Added.
(Object.__proto__.__proto__.Symbol.replace):
(catch):
* Source/JavaScriptCore/runtime/RegExpPrototype.cpp:
(JSC::getSubstitution):
Canonical link: https://commits.webkit.org/308478@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications