only write if the filechunk has len > 0. (#903)

This commit is contained in:
ahrav 2022-11-05 18:19:41 -07:00 committed by GitHub
parent e8cd2e7fae
commit 28983036a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,7 +155,9 @@ func (d *Archive) ReadToMax(reader io.Reader) ([]byte, error) {
return []byte{}, err
}
d.size += bRead
fileContent.Write(fileChunk[0:bRead])
if len(fileChunk) > 0 {
fileContent.Write(fileChunk[0:bRead])
}
if bRead < 512 {
break
}