Skip to content

parser: keyword + # + not-a-string in a macro call not rejected #475

@Kijewski

Description

@Kijewski

https://issues.oss-fuzz.com/issues/422330048

Artifact:

data:application/octet-steam;base64,////e3t6IXtyI319fSAgIP9x//gg

Formatted test case:

#[test]
fn test() -> Result<(), syn::Error> {
    let input = quote! {
        #[template(ext = "", source = "{{ z!{r#} }}")]
//                                           ^^ must be followed by a string literal
        enum q {}
    };
    let output = derive_template(input, import_askama);
    let _: syn::File = syn::parse2(output)?;
    Ok(())
}

Generated code (extract):

z!(r#)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfuzzing errorA bug found by fuzzingparserRelated to the parser

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions