Skip to content

Prevent integer overflow when reading large blobs #1093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BlobReadChannel implements ReadChannel {
private final BlobId blob;
private final Map<StorageRpc.Option, ?> requestOptions;
private String lastEtag;
private int position;
private long position;
private boolean isOpen;
private boolean endOfStream;
private int chunkSize = DEFAULT_CHUNK_SIZE;
Expand Down Expand Up @@ -164,7 +164,7 @@ static class StateImpl implements RestorableState<ReadChannel>, Serializable {
private final BlobId blob;
private final Map<StorageRpc.Option, ?> requestOptions;
private final String lastEtag;
private final int position;
private final long position;
private final boolean isOpen;
private final boolean endOfStream;
private final int chunkSize;
Expand All @@ -185,7 +185,7 @@ static class Builder {
private final BlobId blob;
private final Map<StorageRpc.Option, ?> requestOptions;
private String lastEtag;
private int position;
private long position;
private boolean isOpen;
private boolean endOfStream;
private int chunkSize;
Expand All @@ -201,7 +201,7 @@ Builder lastEtag(String lastEtag) {
return this;
}

Builder position(int position) {
Builder position(long position) {
this.position = position;
return this;
}
Expand Down