fix(update): zip 9's entry name is fallible

Fixes the Windows build after the move to zip 9: an entry whose name can't be read counts as unsafe.
This commit is contained in:
Dylan M. Taylor committed 2026-10-25 12:59:00 -04:00
1 parent a0916808f7
commit dbc86fdbf3
1 file changed
+1 -1
+1 -1
View File
@@ -133,7 +133,7 @@ fn extract(file: &Path, destination: &Path) -> Result<(Vec<PathBuf>, Vec<PathBuf
let mut entry = archive.by_index(index).map_err(|e| e.to_string())?;
let relative = entry.enclosed_name().ok_or("The portable ZIP contains an unsafe path.")?;
if relative.components().any(|c| !matches!(c, Component::Normal(_)))
|| entry.name().contains(['\\', ':'])
|| entry.name().map_or(true, |name| name.contains(['\\', ':']))
|| entry.unix_mode().is_some_and(|mode| mode & 0o170000 == 0o120000)
{
return Err("The portable ZIP contains an unsafe path or link.".into());