From 1e1ac2ad0a1cd3fcaf3882d50de7ea5af3737e9c Mon Sep 17 00:00:00 2001 From: Sosthene-Guedon <51865119+Sosthene-Guedon@users.noreply.github.com> Date: Mon, 10 May 2021 07:15:04 +0200 Subject: [PATCH] Filter yanked advisories (#108) (#109) --- src/engine/machines/analyzer.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/machines/analyzer.rs b/src/engine/machines/analyzer.rs index bb32653..61ad66d 100644 --- a/src/engine/machines/analyzer.rs +++ b/src/engine/machines/analyzer.rs @@ -43,10 +43,14 @@ impl DependencyAnalyzer { let query = database::Query::new().package_version(name, version); if let Some(db) = advisory_db { - let vulnerabilities = db.query(&query); + let vulnerabilities: Vec<_> = db + .query(&query) + .into_iter() + .filter(|vuln| !vuln.metadata.yanked) + .map(|v| v.to_owned()) + .collect(); if !vulnerabilities.is_empty() { - dep.vulnerabilities = - vulnerabilities.into_iter().map(|v| v.to_owned()).collect(); + dep.vulnerabilities = vulnerabilities; } } }