Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regexp: add ErrLarge error #56041

Closed
rsc opened this issue Oct 4, 2022 · 7 comments
Closed

regexp: add ErrLarge error #56041

rsc opened this issue Oct 4, 2022 · 7 comments

Comments

@rsc
Copy link
Contributor

rsc commented Oct 4, 2022

The fix for #55949 introduced various regexp size limits in the regexp parser.
To avoid adding new API, the fix returns ErrInternalError on regexps that are too large.
For Go 1.20 we want to give this error a proper value with a good message.

I propose to add a new ErrorCode:

ErrLarge          ErrorCode = "expression too large"

See also #51684 which added a similar error after a similar security fix.

@rsc rsc added this to the Proposal milestone Oct 4, 2022
@rsc
Copy link
Contributor Author

rsc commented Oct 6, 2022

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc
Copy link
Contributor Author

rsc commented Oct 12, 2022

Based on the discussion above, this proposal seems like a likely accept.
— rsc for the proposal review group

@rsc
Copy link
Contributor Author

rsc commented Oct 20, 2022

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group

@rsc rsc changed the title proposal: regexp: add ErrLarge error regexp: add ErrLarge error Oct 20, 2022
@rsc rsc modified the milestones: Proposal, Backlog Oct 20, 2022
@gopherbot
Copy link

Change https://go.dev/cl/444817 mentions this issue: regexp: add ErrLarge error

gopherbot pushed a commit that referenced this issue Nov 2, 2022
For #56041

Change-Id: I6c98458b5c0d3b3636a53ee04fc97221f3fd8bbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/444817
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: xie cui <523516579@qq.com>
romaindoumenc pushed a commit to TroutSoftware/go that referenced this issue Nov 3, 2022
For golang#56041

Change-Id: I6c98458b5c0d3b3636a53ee04fc97221f3fd8bbc
Reviewed-on: https://go-review.googlesource.com/c/go/+/444817
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: xie cui <523516579@qq.com>
@zephyrtronium
Copy link
Contributor

I noticed this is still open while looking for something unrelated on https://goissues.org/regexp. Is there something else to do here?

@ianlancetaylor
Copy link
Contributor

There is nothing else to do. Thanks for pointing that out.

@dmitshur
Copy link
Contributor

Indeed—this was both implemented (CL 444817) and covered in release notes (https://go.dev/doc/go1.20#regexp). Placing this issue in the corresponding milestone retroactively so it'll be easier to determine when this change happened if looking at this in the future.

@dmitshur dmitshur modified the milestones: Backlog, Go1.20 Apr 17, 2023
@golang golang locked and limited conversation to collaborators Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants