Skip to content

Commit

Permalink
tar/asm: don't add a padding entry if it has no bytes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vbatts committed Jul 21, 2023
1 parent cad1f45 commit b637241
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tar/asm/disassemble.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit b637241

Please sign in to comment.