Skip to content

Can not open certain zip files include data descriptor #2467

@fenghao119

Description

@fenghao119

Expected behavior

Open successful

Actual behavior

throw IllegalStateException("Illegal header in zip file")

Steps to reproduce the problem

(please make this a SSCCE, if applicable and reasonable)

Generate the test.zip file

touch empty.txt
zip -fd foo.zip empty.txt
zip -fd test.zip foo.zip

Test open test.zip

void testCrcAndSizeAfterDataEncapsulated()
{
	Poco::FileInputStream inp("test.zip");
	assertTrue(inp.good());

	ZipArchive arch(inp); // failed with exception
	ZipArchive::FileHeaders::const_iterator it = arch.findHeader("foo.zip");
	assertTrue(it != arch.headerEnd());
}

POCO version

1.9.0

Compiler and version

Any

Operating system and version

Any

Other relevant information

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions