#vulnerable code 
                                @Test
    public void testCorruptChunkedInputStreamInvalidSize() throws IOException {
        final String s = "whatever\r\n01234\r\n5\r\n56789\r\n0\r\n";
        final InputStream in = new ChunkedInputStream(
                new SessionInputBufferMock(
                        EncodingUtils.getBytes(s, CONTENT_CHARSET)));
        try {
            in.read();
            Assert.fail("MalformedChunkCodingException should have been thrown");
        } catch(final MalformedChunkCodingException e) {
            /* expected exception */
        }
    } 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testCorruptChunkedInputStreamInvalidSize() throws IOException {
        final String s = "whatever\r\n01234\r\n5\r\n56789\r\n0\r\n";
        final InputStream in = new ChunkedInputStream(
                new SessionInputBufferMock(
                        EncodingUtils.getBytes(s, CONTENT_CHARSET)));
        try {
            in.read();
            Assert.fail("MalformedChunkCodingException should have been thrown");
        } catch(final MalformedChunkCodingException e) {
            /* expected exception */
        }
        try {
            in.close();
        } catch (TruncatedChunkException expected) {
        }
}