Skip to content

panic at Unrecognized literal  #897

Closed

Description

@alexanderkjall

Hi, I'm going over all the dependencies in my dependency-tree with a fuzzer, and found this panic in syn:

thread 'main' panicked at 'Unrecognized literal: 6E--5458', /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.41/src/lit.rs:955:13

It can be reproduced with this program:

use syn::Expr;

fn main() {
    let s = "6E--5458";
    let _ = syn::parse_str::<Expr>(s);
}

I would have expected it to return an Error instead.

Activity

  1. dtolnay commented on Sep 26, 2020

    @dtolnay
    Owner

    Thank you! I've published syn 1.0.42 with a fix. This issue involved some bugs in proc-macro2 as well so you'll need to update both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions