Skip to content

Commit 62a446d

Browse files
committed
exclude sink patterns
1 parent a68d731 commit 62a446d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sink.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const SINK_PATTERNS: &[&str] = &[
3232
"winapi",
3333
];
3434

35+
const EXCLUDE_SINK_PATTERNS: &[&str] = &["std::io::error"];
36+
3537
// Removed sink patterns on 2023-11-16
3638
// "mio::net",
3739
// "mio::unix",
@@ -58,6 +60,13 @@ impl Sink {
5860
/// Get the sink pattern matching a callee.
5961
pub fn new_match(callee: &CanonicalPath, sinks: &HashSet<IdentPath>) -> Option<Self> {
6062
let mut result = None;
63+
for excluded in EXCLUDE_SINK_PATTERNS {
64+
let pat = Pattern::new(excluded);
65+
if callee.matches(&pat) {
66+
return None;
67+
}
68+
}
69+
6170
for pat_raw in sinks {
6271
let pat = Pattern::new(pat_raw.as_str());
6372
if callee.matches(&pat) {

0 commit comments

Comments
 (0)