ASF Bugzilla – Attachment 35675 Details for
Bug 61993
org.apache.tomcat.util.ByteChunk throws NegativeArray SizeException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
If growing the buffer would overflow int then just set to max value
ByteBufferIssue.patch (text/plain), 841 bytes, created by
Dave Crighton
on 2018-01-12 13:04:33 UTC
(
hide
)
Description:
If growing the buffer would overflow int then just set to max value
Filename:
MIME Type:
Creator:
Dave Crighton
Created:
2018-01-12 13:04:33 UTC
Size:
841 bytes
patch
obsolete
>Index: java/org/apache/tomcat/util/buf/ByteChunk.java >=================================================================== >--- java/org/apache/tomcat/util/buf/ByteChunk.java (revision 1820969) >+++ java/org/apache/tomcat/util/buf/ByteChunk.java (working copy) >@@ -517,8 +517,13 @@ > if( desiredSize <= buff.length ) { > return; > } >+ //If we are over 1Gb then doubling the buffer would overflow int >+ //so instead then set to the max value >+ if(this.buff.length >= 1 * 1024 * 1024 * 1024){ >+ tmp = new byte[Integer.MAX_VALUE - 1]; >+ } > // grow in larger chunks >- if( desiredSize < 2 * buff.length ) { >+ else if( desiredSize < 2 * buff.length ) { > newSize= buff.length * 2; > if( limit >0 && > newSize > limit ) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61993
: 35675