| ... | @@ -536,9 +536,6 @@ pub const Iterator = struct { | ... | @@ -536,9 +536,6 @@ pub const Iterator = struct { |
| 536 | @as(u64, local_header.extra_len); | 536 | @as(u64, local_header.extra_len); |
| 537 | }; | 537 | }; |
| 538 | | 538 | |
| 539 | if (isBadFilename(filename)) | | |
| 540 | return error.ZipBadFilename; | | |
| 541 | | | |
| 542 | if (options.allow_backslashes) { | 539 | if (options.allow_backslashes) { |
| 543 | std.mem.replaceScalar(u8, filename, '\\', '/'); | 540 | std.mem.replaceScalar(u8, filename, '\\', '/'); |
| 544 | } else { | 541 | } else { |
| ... | @@ -546,6 +543,9 @@ pub const Iterator = struct { | ... | @@ -546,6 +543,9 @@ pub const Iterator = struct { |
| 546 | return error.ZipFilenameHasBackslash; | 543 | return error.ZipFilenameHasBackslash; |
| 547 | } | 544 | } |
| 548 | | 545 | |
| | 546 | if (isBadFilename(filename)) |
| | 547 | return error.ZipBadFilename; |
| | 548 | |
| 549 | // All entries that end in '/' are directories | 549 | // All entries that end in '/' are directories |
| 550 | if (filename[filename.len - 1] == '/') { | 550 | if (filename[filename.len - 1] == '/') { |
| 551 | if (self.uncompressed_size != 0) | 551 | if (self.uncompressed_size != 0) |