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

go/scanner: inconsistent handling of NUL bytes in 1.17 #46855

Closed
findleyr opened this issue Jun 21, 2021 · 1 comment
Closed

go/scanner: inconsistent handling of NUL bytes in 1.17 #46855

findleyr opened this issue Jun 21, 2021 · 1 comment

Comments

@findleyr
Copy link
Contributor

Discovered via fuzzing using the dev.fuzz branch: CL 308611 optimized the scanning of identifiers, but inadvertently changed the handling of zero-bytes.

For example, when scanning the following bad input, go 1.17 is missing an error "illegal character NUL", though it does scan the same token stream (including a follow-up error for "illegal character U+0000"): "package p;e\x00"

This might be an improvement, but we should not unintentionally change this behavior for 1.17. The fix is trivial.

CC @griesemer

@findleyr findleyr added this to the Go1.17 milestone Jun 21, 2021
@gopherbot
Copy link

Change https://golang.org/cl/329790 mentions this issue: go/scanner: fall back to next() when encountering 0 bytes in parseIdentifier

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

2 participants