mirror of
https://github.com/rustfs/rustfs.git
synced 2026-11-30 20:57:35 +00:00
perf(policy): bound wildcard matching on adversarial inputs (#9486)
Co-authored-by: Kuromi <kuromiqiyu@gmail.com> Co-authored-by: GatewayJ <835269233@qq.com> Co-authored-by: Hauser Zhi <housemecn@gmail.com> Co-authored-by: Chris An <anzhengchao@gmail.com>
This commit is contained in:
@@ -230,6 +230,12 @@ mod tests {
|
||||
assert!(!is_simple_match("*🎉*🚀", "prefix🎉mid"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_question_mark_matches_bytes_not_unicode_scalars() {
|
||||
assert!(!is_match("prefix?", "prefix界"));
|
||||
assert!(is_match("prefix???", "prefix界"));
|
||||
}
|
||||
|
||||
/// Reference backtracking definition used only for small exhaustive equivalence checks.
|
||||
fn backtracking_match(pattern: &[u8], name: &[u8], simple: bool) -> bool {
|
||||
match pattern.split_first() {
|
||||
|
||||
Reference in New Issue
Block a user