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 Dec 9, 2022
1 parent 9b14468 commit be10983
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 be10983

Please sign in to comment.