-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Resteasy fails with NumberFormatException if file is larger than 2047 MB #17455
Labels
Milestone
Comments
The code causing this bug was introduced with 5cef24b |
geoand
added a commit
to geoand/quarkus
that referenced
this issue
May 31, 2021
An InputStream cannot read over 2GB of memory, but as `available` is only an estimate, there is no good reason for that specific method to fail if content-type indicated a larger payload. Whether or not the processing fails or how it proceeds, should be up to consumer of the stream and will likely have to do with how `read` is implemented. Fixes: quarkusio#17455
geoand
added a commit
that referenced
this issue
May 31, 2021
Make VertxInputStream#available not fail on large content-type
Thank you very much for fixing this quickly, @geoand! Would it be possible to backport this fix to 1.11. or 1.13. ? |
Yeah, that's a good point |
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Jun 3, 2021
An InputStream cannot read over 2GB of memory, but as `available` is only an estimate, there is no good reason for that specific method to fail if content-type indicated a larger payload. Whether or not the processing fails or how it proceeds, should be up to consumer of the stream and will likely have to do with how `read` is implemented. Fixes: quarkusio#17455 (cherry picked from commit 017c53c)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Jun 7, 2021
An InputStream cannot read over 2GB of memory, but as `available` is only an estimate, there is no good reason for that specific method to fail if content-type indicated a larger payload. Whether or not the processing fails or how it proceeds, should be up to consumer of the stream and will likely have to do with how `read` is implemented. Fixes: quarkusio#17455 (cherry picked from commit 017c53c)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In my service I receive an InputStream in my REST endpoint and use this inputstream directly to store the data in MinIO.
Everything is working well except if the request contains a "Content Length" header and the file is larger than 2047 MB. In this case a NumberFormatException happens because in
VertxInputStream.java
the header is parsed as int" in methodpublic int readBytesAvailable()
line, 297.Stacktrace:
If no Content Length header is given everythings works fine for large files as well, since the readBytesAvailable method simply returns 0 in this case.
Environment (please complete the following information):
Output of
java -version
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
GraalVM version (if different from Java)
Quarkus version or git rev
1.11.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
The text was updated successfully, but these errors were encountered: