-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prevent integer overflow when reading large blobs #1093
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
@tbeatty this issue has been fixed and a new version (0.2.5) of gcloud-java released. Thanks again for this PR! |
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [3.4.2](https://togithub.com/googleapis/java-aiplatform/compare/v3.4.1...v3.4.2) (2022-10-10) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-aiplatform-v1beta1 to v0.20.1 ([#1091](https://togithub.com/googleapis/java-aiplatform/issues/1091)) ([b290e10](https://togithub.com/googleapis/java-aiplatform/commit/b290e106e50c7e3a60379debc59987c80695f808)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.17.1 ([#1092](https://togithub.com/googleapis/java-aiplatform/issues/1092)) ([c748a9a](https://togithub.com/googleapis/java-aiplatform/commit/c748a9a8b175095bb0efd3d8e4382eab00c25992)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
The
position
instance variable ofBlobReadChannel
overflows when reading blobs with size larger thanInteger.MAX_VALUE
. This results in a request against the storage api with an invalidRange
header.The api ignores the invalid range header, which results in the the entire file being downloaded. When an array is allocated to hold the contents of the file, the runtime throws an
OutOfMemoryError
.The issue can be reproduced as follows:
Create a large random file
Confirm the file size is greater than
Integer.MAX_VALUE
Create a bucket and upload the file
Use
com.google.cloud.examples.storage.StorageExample
to download the fileResult: