From 63382421548ad720b5a9b123012ccabc766d8b04 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Thu, 7 Mar 2024 15:23:56 -0800 Subject: [PATCH] Bug fix: `dir_end` was being set incorrectly --- src/read.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/read.rs b/src/read.rs index e05172bf..a9aedadd 100644 --- a/src/read.rs +++ b/src/read.rs @@ -482,12 +482,13 @@ impl ZipArchive { }; let mut files = Vec::with_capacity(file_capacity); let mut names_map = HashMap::with_capacity(file_capacity); - let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; + reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; for _ in 0..dir_info.number_of_files { let file = central_header_to_zip_file(reader, dir_info.archive_offset)?; names_map.insert(file.file_name.clone(), files.len()); files.push(file); } + let dir_end = reader.seek(io::SeekFrom::Start(dir_info.directory_start))?; if dir_info.disk_number != dir_info.disk_with_central_directory { unsupported_zip_error("Support for multi-disk files is not implemented") } else {