Skip to content

Possible to cause a panic with gsub #1

@ghost

Description

use lua_patterns::LuaPattern;

fn main() {
    let mut m = LuaPattern::from_bytes(&[160]);
    let s = "⚠";
    s.bytes().for_each(|b| println!("{}" , b));

    m.gsub(s , "");
}

The ⚠ is made up of the bytes [226 , 154 , 160] removing the 160 causes the string to become invalid unicode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions