Skip to content

Prevent integer overflow in regex repetition count#263

Merged
plan9 merged 1 commit into
onetrueawk:stagingfrom
millert:re_dup_max
Apr 26, 2026
Merged

Prevent integer overflow in regex repetition count#263
plan9 merged 1 commit into
onetrueawk:stagingfrom
millert:re_dup_max

Conversation

@millert
Copy link
Copy Markdown
Contributor

@millert millert commented Apr 2, 2026

This fixes two potential crashes:

  • limit the repetition count to 255 like POSIX does to prevent signed integer overflow
  • prevent a crash when the repetition is the first atom parsed

From Renaud Allard via OpenBSD

Limit the repetition count to 255 like POSIX does.  Also avoid a
crash when the repetition is the first atom parsed.

From Renaud Allard.
@plan9
Copy link
Copy Markdown
Collaborator

plan9 commented Apr 2, 2026

thanks Todd, and also thanks to mr Allard. I'll review and merge as soon as I can.

@plan9 plan9 merged commit b972b73 into onetrueawk:staging Apr 26, 2026
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