Skip to content

Panic Could not find EOCD for a valid file #454

@EpicPix

Description

@EpicPix

Describe the bug
I get a InvalidArchive("Could not find EOCD") panic, even though the file works with other tools

To Reproduce
Download https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.6.0/jna-5.6.0.jar
Try running

fn main() {
    let file = std::fs::File::open("jna-5.6.0.jar").unwrap();
    let reader = std::io::BufReader::new(file);
    let archive = zip::ZipArchive::new(reader).expect("invalid archive");
    println!("{}", archive.len());
}

with any version of zip (2.3.0 or newer, tho, it works properly on version 1.1.4, but I couldn't check in between those versions, because they've been yanked)

Expected behavior
I expected to see the number 170 printed

Desktop (please complete the following information):

  • OS: Arch Linux
  • Rust: 1.89-x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Amazon Q development agentGenerate new features or iterate code based on issue descriptions and comments.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions