Skip to content

Commit b637241

Browse files
committed
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 <[email protected]>
1 parent cad1f45 commit b637241

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tar/asm/disassemble.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
135135
}
136136
isEOF = true
137137
}
138+
if n == 0 {
139+
break
140+
}
138141
_, err = p.AddEntry(storage.Entry{
139142
Type: storage.SegmentType,
140143
Payload: paddingChunk[:n],

0 commit comments

Comments
 (0)