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

tokenizer: Fix index-out-of-bounds on string_literal_backslash right before EOF #9808

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

squeek502
Copy link
Collaborator

Before this fix, the added test would fail with something like:

thread 3287298 panic: index out of bounds
/home/ryan/Programming/zig/zig/build/lib/zig/std/zig/tokenizer.zig:408:34: 0x21511f in std.zig.tokenizer.Tokenizer.next (fuzz-debug)
            const c = self.buffer[self.index];
                                 ^
/home/ryan/Programming/zig/zig/build/lib/zig/std/zig/parse.zig:24:37: 0x20af60 in std.zig.parse.parse (fuzz-debug)
        const token = tokenizer.next();
                                    ^

This was found by fuzzing the tokenizer with https://github.com/squeek502/zig-std-lib-fuzzing

(this is just the beginning, there are lots more tokenizer crashes that have been found)

@andrewrk
Copy link
Member

Thanks!

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