hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCORE-312) LengthDelimitedEncoder fails on content length > 32 bit
Date Mon, 17 Sep 2012 20:06:08 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457268#comment-13457268

Oleg Kalnichevski commented on HTTPCORE-312:

I just applied some changes that I believe should fix the problem


If you happen to have a test case could you please re-run it with the latest snapshot off
the 4.2.x branch? I'll start the release process for 4.2.2 as soon as the fix is confirmed.

> LengthDelimitedEncoder fails on content length > 32 bit
> -------------------------------------------------------
>                 Key: HTTPCORE-312
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-312
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.2
>            Reporter: Roland Hänel
>            Priority: Critical
>             Fix For: 4.2.2
> The LengthDelimitedEncoder class fails to deliver contents that are larger than 2GB,
because the write(final ByteBuffer src) method incorrectly calculates
>    int lenRemaining = (int) (this.contentLength - this.len);
> For example, if this.contentLength is 3,000,000,000 and this.len is 0, then lenRemaining
will be negative and things will go wrong in the process.
> Changing the line to
>    long lenRemaining = this.contentLength - this.len;
> will fix this bug (maybe src.remaining() needs to be casted to (long) in the following
if statement).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message