-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
syntax: Parser does not handle unescaped slash as original value in replacement parameter expansion #1076
Comments
Thanks for the detailed report! |
@mvdan We use this library as part of gitlab.com/gitlab-org/gitlab-runner and had a customer stumble across this problem. I was wondering if you would be able to release a new version of this library so that we can upgrade with this fix included? Thank you! |
@saracen sure, a release is due, I'll do one once Go 1.23.0 is out in the coming days. Just to note that you should still be able to use the latest master commit in any case. |
When parsing this snippet:
The following AST is generated:
Note that
Orig
is nilFull AST
Providing the double quoted parameter expression to
expand.Document()
then results in a segfault, becauseparamExp
passes a nil Orig to Pattern, which then tries to reference fields from it.Reproducer
Error:
Running this in other shells (bash/ash) works:
The text was updated successfully, but these errors were encountered: