Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.4.10
-
None
Description
DefaultConnectionReuseStrategy uses Integer.parseInt to parse Content-Length header. For size > 2 GB, parsing fails with NumberFormatException.
Stack trace
parseInt:658, Integer (java.lang) parseInt:776, Integer (java.lang) keepAlive:136, DefaultConnectionReuseStrategy (org.apache.http.impl) keepAlive:62, DefaultClientConnectionReuseStrategy (org.apache.http.impl.client) execute:275, MainClientExec (org.apache.http.impl.execchain) execute:186, ProtocolExec (org.apache.http.impl.execchain) execute:89, RetryExec (org.apache.http.impl.execchain) doExecute:185, InternalHttpClient (org.apache.http.impl.client) execute:83, CloseableHttpClient (org.apache.http.impl.client)
Line 90 & 136:
final int contentLen = Integer.parseInt(clh.getValue());
Should use Long.parseLong instead.