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
{{ message }}
Repository navigation
CreateZip an empty file produces a corrupted zip file. #391
I think this is a variant of #382, but for ZipOutputStream rather than GZipOutputStream (revealed by the same Deflator change, but possibly an existing issue), whereby:
When FastZip adds the 0 length entry to ZipOutputStream, the compression method gets set to Stored.
The stream copy utility function that FastZip uses to write file entries flushes the ZipOutputStream, even though no data was written for the entry.
The call to Flush goes through to the base DeflatorOutputStream, which flushes the Deflator into the base stream even though there is no Deflation in use.
The change to the deflator behaviour in #225 might have caused this process to write some data into an entry that is supposed to be 0 length causing the data structure in the output stream to be wrong, but in any case, I wou;dn't have thought that flushing ZipOutputStream should flush the Deflator when working on a Stored entry anyway?
Activity
Numpsy commentedon Oct 13, 2019
I think this is a variant of #382, but for ZipOutputStream rather than GZipOutputStream (revealed by the same Deflator change, but possibly an existing issue), whereby:
The change to the deflator behaviour in #225 might have caused this process to write some data into an entry that is supposed to be 0 length causing the data structure in the output stream to be wrong, but in any case, I wou;dn't have thought that flushing ZipOutputStream should flush the Deflator when working on a Stored entry anyway?
piksel commentedon Dec 30, 2019
Confirmed and added a test (that fails). Will probably be solved in #398
piksel commentedon Nov 21, 2020
Fixed by #406