Skip to content

Commit

Permalink
add check on response length
Browse files Browse the repository at this point in the history
Signed-off-by: zombee0 <ewang2027@gmail.com>
  • Loading branch information
zombee0 committed Aug 14, 2024
1 parent c25637c commit 22d9a34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions be/src/io/s3_input_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ StatusOr<int64_t> S3InputStream::read(void* out, int64_t count) {

Aws::S3::Model::GetObjectOutcome outcome = _s3client->GetObject(request);
if (outcome.IsSuccess()) {
if (UNLIKELY(outcome.GetResult().GetContentLength() != real_length)) {
return Status::InternalError("The response length is different from request length for io stream!");
}
_offset += real_length;
return real_length;
} else {
Expand Down

0 comments on commit 22d9a34

Please sign in to comment.