Skip to content

Commit

Permalink
[fix][offload] Fix numerical overflow bug while reading data from tie…
Browse files Browse the repository at this point in the history
…red storage (apache#18595)

Co-authored-by: druidliu <[email protected]>
  • Loading branch information
2 people authored and lifepuzzlefun committed Jan 10, 2023
1 parent 2d67aa4 commit 6b1bea9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public void close() {

@Override
public int available() throws IOException {
return (int) (objectLen - cursor) + buffer.readableBytes();
long available = objectLen - cursor + buffer.readableBytes();
return available > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) available;
}
}

0 comments on commit 6b1bea9

Please sign in to comment.