tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54456] ChunkedInputFilter returning EOF when client closes connection without sending end chunk
Date Tue, 05 Feb 2013 22:34:41 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54456

Konstantin Kolinko <knst.kolinko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from Konstantin Kolinko <knst.kolinko@gmail.com> ---
The following lines in ChunkedInputFilter.java (162-164 in trunk)

        if (pos >= lastValid) {
            readBytes();
        }

is the only place in this file where the return value of "readBytes()" is not
checked. 

Looking at the code, if the method returns -1 then (lastValid - pos) will be -1
and it will proceed with "chunk.setBytes(buf, pos, result);", which seems a
wrong thing to do in such a case.

I have not tested what is the actual behaviour here, but an explicit "return
-1" or "throw new EOFException()" would be better.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Mime
View raw message