mirror of
https://github.com/restic/restic.git
synced 2026-06-21 08:04:18 +00:00
backend/rest: correctly close body on out of bounds read
This commit is contained in:
@@ -245,6 +245,7 @@ func (b *Backend) openReader(ctx context.Context, h backend.Handle, length int,
|
||||
}
|
||||
|
||||
if feature.Flag.Enabled(feature.BackendErrorRedesign) && length > 0 && resp.ContentLength != int64(length) {
|
||||
_ = drainAndClose(resp)
|
||||
return nil, &restError{h, http.StatusRequestedRangeNotSatisfiable, "partial out of bounds read"}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user