mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
only write if the filechunk has len > 0. (#903)
This commit is contained in:
parent
e8cd2e7fae
commit
28983036a0
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue