mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibRegex: Fix crash when parse result exceeds max cache size
Before, If the cache was empty we would try and evict non-existant entries and crash. So the fix is to make sure that we don't saturate the cache with a single parse result.
This commit is contained in:
parent
99df80f81e
commit
83e46b3728
Notes:
github-actions[bot]
2025-04-04 14:11:28 +00:00
Author: https://github.com/ttrssreal
Commit: 83e46b3728
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4221
Reviewed-by: https://github.com/alimpfard ✅
2 changed files with 21 additions and 6 deletions
|
@ -77,3 +77,7 @@ test("v flag should enable unicode mode", () => {
|
|||
const re = new RegExp("a\\u{10FFFF}", "v");
|
||||
expect(re.test("a\u{10FFFF}")).toBe(true);
|
||||
});
|
||||
|
||||
test("parsing a large bytestring shouldn't crash", () => {
|
||||
RegExp(new Uint8Array(0x40000));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue