Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
archive/zip: off-by-one writing directory64 records #14186
records should definitely be >= since there is an additional end record. I think the size needs to account for directoryEndLen extra bytes. I don't see why offset needs to be >= however. So I propose this set of rules:
In the zip format encoding, the ^0 value means "there is a bigger value encoded next". If you encode offset 0xFFFFFFFF meaning 0xFFFFFFFF, a decoder will see it as "there's a 64-bit value coming next". If the encoding does not include that 64-bit value, the decoder will get confused. See CL 18317 for an example of this with the file data size field.