[Issue 20523] New: std.zip: Invalid data yields RangeError in ZipArchive constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 21 18:40:11 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20523

          Issue ID: 20523
           Summary: std.zip: Invalid data yields RangeError in ZipArchive
                    constructor
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

Test case for a truncated zip file:

unittest
{
    enum data =
"\x50\x4b\x01\x02\x50\x4b\x05\x06\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";

    scope zip = new ZipArchive(cast(void[]) data);
}

This causes a range error at std.zip.d:1335

--


More information about the Digitalmars-d-bugs mailing list