Bug 20287 – std.zip: Wrong compressed data

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-10T12:33:38Z
Last change time
2019-10-10T14:19:59Z
Keywords
pull
Assigned to
No Owner
Creator
berni44

Comments

Comment #0 by bugzilla — 2019-10-10T12:33:38Z
unittest { auto file = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x8f\x72\x4a\x4f\x86\xa6"~ "\x10\x36\x05\x00\x00\x00\x05\x00\x00\x00\x04\x00\x1c\x00\x66\x69"~ "\x6c\x65\x55\x54\x09\x00\x03\x0d\x22\x9f\x5d\x12\x22\x9f\x5d\x75"~ "\x78\x0b\x00\x01\x04\xf0\x03\x00\x00\x04\xf0\x03\x00\x00\x68\x65"~ "\x6c\x6c\x6f\x50\x4b\x01\x02\x1e\x03\x0a\x00\x00\x00\x00\x00\x8f"~ "\x72\x4a\x4f\x86\xa6\x10\x36\x05\x00\x00\x00\x05\x00\x00\x00\x04"~ "\x00\x18\x00\x00\x00\x00\x00\x01\x00\x00\x00\xb0\x81\x00\x00\x00"~ "\x00\x66\x69\x6c\x65\x55\x54\x05\x00\x03\x0d\x22\x9f\x5d\x75\x78"~ "\x0b\x00\x01\x04\xf0\x03\x00\x00\x04\xf0\x03\x00\x00\x50\x4b\x05"~ "\x06\x00\x00\x00\x00\x01\x00\x01\x00\x4a\x00\x00\x00\x43\x00\x00"~ "\x00\x00\x00"; auto za = new ZipArchive(cast(void[]) file); assert(za.directory["file"].compressedData == [104, 101, 108, 108, 111]); } When using expand() on an archive member, compressedData is overwritten by the correct data. Therefore, probably, noone noticed this bug.
Comment #1 by dlang-bot — 2019-10-10T12:57:25Z
@berni44 updated dlang/phobos pull request #7221 "Fix 20287 - std.zip: Wrong compressed data" fixing this issue: - Fix issue 20287 - std.zip: Wrong compressed data https://github.com/dlang/phobos/pull/7221
Comment #2 by dlang-bot — 2019-10-10T14:19:59Z
dlang/phobos pull request #7221 "Fix issue 20287 - std.zip: Wrong compressed data" was merged into master: - d093fe528292a420bb0fee1da00f125f45c5a4c1 by Bernhard Seckinger: Fix issue 20287 - std.zip: Wrong compressed data https://github.com/dlang/phobos/pull/7221