Skip to content

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

Closed
@findleyr

Description

@findleyr

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions