diff --git a/s3api/utils/signed-chunk-reader.go b/s3api/utils/signed-chunk-reader.go index 2b2c6c36..4ece3607 100644 --- a/s3api/utils/signed-chunk-reader.go +++ b/s3api/utils/signed-chunk-reader.go @@ -230,11 +230,14 @@ const ( maxHeaderSize = 1024 ) -// Theis returns the chunk payload size, signature, data start offset, and +// This returns the chunk payload size, signature, data start offset, and // error if any. See the AWS documentation for the chunk header format. The // header[0] byte is expected to be the first byte of the chunk size here. func (cr *ChunkReader) parseChunkHeaderBytes(header []byte) (int64, string, int, error) { stashLen := len(cr.stash) + if stashLen > maxHeaderSize { + return 0, "", 0, errInvalidChunkFormat + } if cr.stash != nil { tmp := make([]byte, maxHeaderSize) copy(tmp, cr.stash)