mirror of
https://github.com/restic/restic.git
synced 2026-11-25 07:16:54 +00:00
Fix special case with null byte input
This commit is contained in:
1 parent
b3a4bbc850
commit
83ea81d8c3
2 files changed
+23
-9
No files matched your search
+9
-7
@@ -154,13 +154,15 @@ func (c *chunker) Next() (*Chunk, error) {
|
||||
if err == io.EOF && !c.closed {
|
||||
c.closed = true
|
||||
|
||||
// return current chunk
|
||||
return &Chunk{
|
||||
Start: c.start,
|
||||
Length: c.count,
|
||||
Cut: c.digest,
|
||||
Data: c.data,
|
||||
}, nil
|
||||
// return current chunk, if any bytes have been processed
|
||||
if c.count > 0 {
|
||||
return &Chunk{
|
||||
Start: c.start,
|
||||
Length: c.count,
|
||||
Cut: c.digest,
|
||||
Data: c.data,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user