tar/asm: don't add a padding entry if it has no bytes

Fixes #65

if the read bytes is 0, then don't even create the entry for that
padding.
This sounds like the solution for the issue opened, but I haven't found
a reproducer for this issue yet. :-\

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-07-21 08:59:22 -04:00
parent cad1f451fd
commit b6372414e5
Signed by: vbatts
GPG Key ID: E30EFAA812C6E5ED
1 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,9 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
}
isEOF = true
}
if n == 0 {
break
}
_, err = p.AddEntry(storage.Entry{
Type: storage.SegmentType,
Payload: paddingChunk[:n],