forked from TrueCloudLab/restic
Extended plaintext buffer if necessary
This commit is contained in:
parent
0e6c72ad1d
commit
d609e4a986
1 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,11 @@ func Repack(repo *Repository, packs, keepBlobs backend.IDSet) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ciphertext := buf[entry.Offset : entry.Offset+entry.Length]
|
ciphertext := buf[entry.Offset : entry.Offset+entry.Length]
|
||||||
|
|
||||||
|
if cap(plaintext) < len(ciphertext) {
|
||||||
|
plaintext = make([]byte, len(ciphertext))
|
||||||
|
}
|
||||||
|
|
||||||
plaintext, err = crypto.Decrypt(repo.Key(), plaintext, ciphertext)
|
plaintext, err = crypto.Decrypt(repo.Key(), plaintext, ciphertext)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue