You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A trailing forward-slash indicates intent to encode a directory. The API for Create and CreateHeader returns an io.Writer, which allows a user to write "data" for a directory, which has no sensible meaning. It turns out that the Writer does actually encode the data into the archive, but the various zip readers I tested just ignore the data.
I believe the io.Writer returned by Create and CreateHeader should just return an error.
The text was updated successfully, but these errors were encountered:
dsnet
changed the title
archive/zip: allows creation of invalid directories
archive/zip: allows writing data for a directory
Feb 22, 2018
- Stop asserting the compression mode on directories in zip archives
(see golang/go#24043)
- Re-order assertions to remove looping and group by file
[#160911621]
Signed-off-by: Will Murphy <wmurphy@pivotal.io>
Consider the following:
A trailing forward-slash indicates intent to encode a directory. The API for
Create
andCreateHeader
returns anio.Writer
, which allows a user to write "data" for a directory, which has no sensible meaning. It turns out that the Writer does actually encode the data into the archive, but the various zip readers I tested just ignore the data.I believe the
io.Writer
returned byCreate
andCreateHeader
should just return an error.The text was updated successfully, but these errors were encountered: