Skip to content

Commit

Permalink
add two test cases for duplicate UTF 8 name and comment EFs
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wiz-0 committed Jul 28, 2024
1 parent 4b11a65 commit 4927d88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Binary file added regress/incons-ef-local-dupe-utf8comment.zip
Binary file not shown.
Binary file added regress/incons-ef-local-dupe-utf8name.zip
Binary file not shown.
8 changes: 6 additions & 2 deletions regress/open_incons.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ file incons-central-magic-bad2.zzip incons-central-magic-bad2.zip
file incons-central-size-larger.zzip incons-central-size-larger.zip
file incons-data.zzip incons-data.zip
file incons-ef-central-size-wrong.zzip incons-ef-central-size-wrong.zip
file incons-ef-local-dupe-utf8comment.zzip incons-ef-local-dupe-utf8comment.zip
file incons-ef-local-dupe-utf8name.zzip incons-ef-local-dupe-utf8name.zip
file incons-ef-local-id-size.zzip incons-ef-local-id-size.zip
file incons-ef-local-id.zzip incons-ef-local-id.zip
file incons-ef-local-size.zzip incons-ef-local-size.zip
Expand All @@ -38,7 +40,7 @@ file incons-local-filename.zzip incons-local-filename.zip
file incons-local-magic-bad.zzip incons-local-magic-bad.zip
file incons-local-size-larger.zzip incons-local-size-larger.zip
file incons-stored-size.zzip incons-stored-size.zip
arguments -c incons-archive-comment-longer.zzip incons-archive-comment-shorter.zzip incons-cdoffset.zzip incons-central-compression-method.zzip incons-central-compsize-larger-toolarge.zzip incons-central-compsize-larger.zzip incons-central-compsize-smaller.zzip incons-central-crc.zzip incons-central-date.zzip incons-central-file-comment-longer.zzip incons-central-file-comment-shorter.zzip incons-central-magic-bad.zzip incons-central-magic-bad2.zzip incons-central-size-larger.zzip incons-data.zzip incons-ef-central-size-wrong.zzip incons-ef-local-id-size.zzip incons-ef-local-id.zzip incons-ef-local-size.zzip incons-eocd-magic-bad.zzip incons-file-count-high.zzip incons-file-count-low.zzip incons-file-count-overflow.zzip incons-gap-before-cd.zzip incons-gap-before-eocd.zzip incons-gap-before-local.zzip incons-local-compression-method.zzip incons-local-compsize-larger.zzip incons-local-compsize-smaller.zzip incons-local-crc.zzip incons-local-filename-long.zzip incons-local-filename-missing.zzip incons-local-filename-nil-byte.zzip incons-local-filename-short.zzip incons-local-filename.zzip incons-local-magic-bad.zzip incons-local-size-larger.zzip incons-stored-size.zzip
arguments -c incons-archive-comment-longer.zzip incons-archive-comment-shorter.zzip incons-cdoffset.zzip incons-central-compression-method.zzip incons-central-compsize-larger-toolarge.zzip incons-central-compsize-larger.zzip incons-central-compsize-smaller.zzip incons-central-crc.zzip incons-central-date.zzip incons-central-file-comment-longer.zzip incons-central-file-comment-shorter.zzip incons-central-magic-bad.zzip incons-central-magic-bad2.zzip incons-central-size-larger.zzip incons-data.zzip incons-ef-central-size-wrong.zzip incons-ef-local-dupe-utf8comment.zzip incons-ef-local-dupe-utf8name.zzip incons-ef-local-id-size.zzip incons-ef-local-id.zzip incons-ef-local-size.zzip incons-eocd-magic-bad.zzip incons-file-count-high.zzip incons-file-count-low.zzip incons-file-count-overflow.zzip incons-gap-before-cd.zzip incons-gap-before-eocd.zzip incons-gap-before-local.zzip incons-local-compression-method.zzip incons-local-compsize-larger.zzip incons-local-compsize-smaller.zzip incons-local-crc.zzip incons-local-filename-long.zzip incons-local-filename-missing.zzip incons-local-filename-nil-byte.zzip incons-local-filename-short.zzip incons-local-filename.zzip incons-local-magic-bad.zzip incons-local-size-larger.zzip incons-stored-size.zzip
return 1
# tryopen does not test checksums, so this is fine.
# different extra fields local vs. central is fine
Expand All @@ -59,6 +61,8 @@ opening 'incons-central-magic-bad2.zzip' returned error 35
opening 'incons-central-size-larger.zzip' returned error 21/6
opening 'incons-data.zzip' succeeded, 1 entries
opening 'incons-ef-central-size-wrong.zzip' returned error 21/16
opening 'incons-ef-local-dupe-utf8comment.zzip' succeeded, 1 entries
opening 'incons-ef-local-dupe-utf8name.zzip' returned error 21/6

This comment has been minimized.

Copy link
@ouuan

ouuan Jul 29, 2024

It seems that this error comes from that the extra field is only present in LFH but not CDH, not that libzip already checks for duplicate extra fields.

opening 'incons-ef-local-id-size.zzip' returned error 21/16
opening 'incons-ef-local-id.zzip' succeeded, 1 entries
opening 'incons-ef-local-size.zzip' returned error 21/16
Expand All @@ -83,5 +87,5 @@ opening 'incons-local-size-larger.zzip' returned error 21/6
opening 'incons-stored-size.zzip' succeeded, 1 entries
end-of-inline-data
stderr
32 errors
33 errors
end-of-inline-data

0 comments on commit 4927d88

Please sign in to comment.