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 (#18595)

Co-authored-by: druidliu <[email protected]>
(cherry picked from commit 5c34e84)
  • Loading branch information
dragonls authored and lhotari committed Nov 28, 2022
1 parent 1c6abae commit 9bf3e3f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,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 9bf3e3f

Please sign in to comment.