mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
parent
b0fb95dfc9
commit
d76fa22b4b
1 changed files with 4 additions and 2 deletions
|
@ -230,11 +230,13 @@ func readHeader(rd io.ReaderAt, size int64) ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if int64(hl) > size-int64(binary.Size(hl)) {
|
if int64(hl) > size-int64(binary.Size(hl)) {
|
||||||
return nil, errors.New("header is larger than file")
|
err := InvalidFileError{Message: "header is larger than file"}
|
||||||
|
return nil, errors.Wrap(err, "readHeader")
|
||||||
}
|
}
|
||||||
|
|
||||||
if int64(hl) > maxHeaderSize {
|
if int64(hl) > maxHeaderSize {
|
||||||
return nil, errors.New("header is larger than maxHeaderSize")
|
err := InvalidFileError{Message: "header is larger than maxHeaderSize"}
|
||||||
|
return nil, errors.Wrap(err, "readHeader")
|
||||||
}
|
}
|
||||||
|
|
||||||
buf := make([]byte, int(hl))
|
buf := make([]byte, int(hl))
|
||||||
|
|
Loading…
Reference in a new issue