Skip to content

LRE fixes - #1377

Merged
saghul merged 2 commits into
masterfrom
worktree-lre-fixes
Mar 4, 2026
Merged

saghul merged 2 commits into
masterfrom
worktree-lre-fixes

Conversation

@saghul

@saghul saghul commented Mar 3, 2026

Copy link
Copy Markdown
Contributor
  • Validate save index in lre_exec_backtrack
  • Validate opcodes in lre_byte_swap

Comment thread libregexp.c Resolved
@saghul
saghul force-pushed the worktree-lre-fixes branch from 5ae4562 to 561d927 Compare March 3, 2026 20:33
@saghul

saghul commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@bnoordhuis Can you PTAL? I added the extra error constant and checking, plus handling of lre_byte_swap errors that I had missed.

Comment thread quickjs.c Resolved
Comment thread quickjs.c Resolved
saghul added 2 commits March 4, 2026 22:48
Fixes: #1375

Replace assert() with runtime check for REOP_save_start/REOP_save_end/
REOP_save_reset capture indices.

Also add lre-test with a test for this issue, and the starting point for
more lre tests.
Fixes: #1376

Check that opcode bytes are < REOP_COUNT before indexing into the
reopcode_info array.

Also change lre_byte_swap to return int (-1 on error, 0 on success)
instead of aborting, and handle the error gracefully.
@saghul
saghul force-pushed the worktree-lre-fixes branch from 561d927 to 97bda29 Compare March 4, 2026 21:48
@saghul
saghul merged commit a59c6d6 into master Mar 4, 2026
122 checks passed
@saghul
saghul deleted the worktree-lre-fixes branch March 4, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants