jira-importer opened a new issue, #1477:
URL: https://github.com/apache/httpcomponents-core/issues/1477

   **[Steve 
Loughran](https://issues.apache.org/jira/secure/[email protected])**
 opened 
**[HTTPCORE-235](https://issues.apache.org/jira/browse/HTTPCORE-235?redirect=false)**
 and commented
   
   Also on my review of EntityUtils.toString(), I see that it's code to take an 
input stream and a content length only uses the content length parameter to set 
the size of the buffer -there is no attempt to verify that the amount of data 
received was as expected and raise an `IOException` if less data arrived.
   
   While this code will appear to work, especially on loopback and local 
connections, it is flawed long-haul where connections are often dropped early.
   
   I propose streaming the entity content to a byte array, validating the 
length, then building a string in the appropriate charset from the buffer if it 
is valid.
   
   
   
   ---
   
   **Affects:** 4.0.1
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to