From 6d24aaa99703149559a12b9b81961032b204060d Mon Sep 17 00:00:00 2001 From: DoubleD17 <48109637+DoubleD17@users.noreply.github.com> Date: Tue, 24 Nov 2026 16:16:15 +0000 Subject: [PATCH] Deduplicate image paths in victory census (cherry picked from commit 142ec8dd4563608b67ffabc8ba47175508f9a660) --- apps/victory/src/census.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/victory/src/census.rs b/apps/victory/src/census.rs index 1314efb..6520bb6 100644 --- a/apps/victory/src/census.rs +++ b/apps/victory/src/census.rs @@ -42,6 +42,7 @@ pub fn run(paths: Vec, strict: bool, list_missing: bool) -> Result<()> }); let mut images = 0usize; + let mut seen = BTreeSet::new(); let mut failed = Vec::new(); let mut dlls: BTreeMap = BTreeMap::new(); let mut missing: BTreeMap<(String, String), BTreeSet> = BTreeMap::new(); @@ -62,6 +63,11 @@ pub fn run(paths: Vec, strict: bool, list_missing: bool) -> Result<()> if !entry.file_type().is_file() || !looks_like_pe(path) { continue; } + // Use the resolved path for deduplication and keep the original for output. + let identity = path.canonicalize().unwrap_or_else(|_| path.to_path_buf()); + if !seen.insert(identity) { + continue; + } let info = match std::fs::read(path) .map_err(anyhow::Error::from) .and_then(|d| ImageInfo::parse(&d).map_err(anyhow::Error::from))