fix(headers): prevent 2 panics in QualityItem parsing
1. index out of bounds if semicolon is the last character 2. not a char boundary on non-ASCII input (only allow ASCII now) Bugs found using `cargo fuzz`
This commit is contained in:
@@ -114,6 +114,11 @@ header! {
|
||||
SubLevel::Plain, vec![(Attr::Charset, Value::Utf8)]),
|
||||
Quality(500)),
|
||||
])));
|
||||
test_header!(
|
||||
test_fuzzing1,
|
||||
vec![b"chunk#;e"],
|
||||
None
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user