-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Integer Overflow In BaseWriteChannel #1389
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
Comments
Uh very sorry for the panic and mayhem. I believe we have fixed an analogous issue for the reader and this was left behind. A PR would be awesome, it should be as simple as making |
Can I ask you to do it? I don't have the code base checked out, was debugging against the sources jar. |
This is kind of my job so I'll be more than happy :D |
Looks like I'm talking to the right guy :) |
Thanks! Any idea when the fix will be released? |
@Dima1224 Beginning of next week the latest! |
Thanks for the lightning fast turnaround once again, @mziccard! Much appreciated. |
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 454027580 Source-Link: googleapis/googleapis@1b22277 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9
… v3.7.0 (googleapis#1389) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-asset](https://togithub.com/googleapis/java-asset) | `3.6.0` -> `3.7.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMTQuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIxNC4wIn0=-->
Hi there. I'm testing out com.google.cloud.storage.Storage.writer() for writing to GCS. It works very well for files smaller than 2GB, but right around the 2GB mark WriteChannel throws an exception indicating that there's something wrong with the Content-Range header.
com.google.api.client.http.HttpResponseException: 400|Failed to parse Content-Range header.
I noticed that the Content-Range header is set in com.google.cloud.storage.spi.DefaultStorageRpc.write() and is calculated using com.google.cloud.BaseWriteChannel.position, which is an int. The problem is that at the 2GB mark the position variable overflows and becomes negative, causing panic and mayhem.
Here are some screenshots to paint a fuller picture:
Any chance we can get a patch for this? Should I submit a pull request?
The text was updated successfully, but these errors were encountered: