[ https://issues.apache.org/jira/browse/DIRMINA-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julien Vermillard closed DIRMINA-530. ------------------------------------- > Compression filter - trivial bug fix and fix for use with SSL > ------------------------------------------------------------- > > Key: DIRMINA-530 > URL: https://issues.apache.org/jira/browse/DIRMINA-530 > Project: MINA > Issue Type: Bug > Components: Filter > Affects Versions: 1.0.9, 1.1.6, 2.0.0-M1 > Environment: N/A? But Mac OS X Leopard (Java 1.5) does display the > issue. > Reporter: Justin SB > Assignee: Trustin Lee > Fix For: 1.0.10, 1.1.7, 2.0.0-M2 > > Attachments: patch-compression.diff > > > The compression filter has a simple bug, where it uses limit() instead of > remaining(). Where position != 0, this causes reads to exceed available data: > - byte[] inBytes = new byte[inBuffer.limit()]; > + byte[] inBytes = new byte[inBuffer.remaining()]; > inBuffer.get(inBytes).flip(); > > Also, when the compression filter is chained with the SSL filter, and SSL > status notification is enabled, the SSL filter sends state messages through > the chain. These are not IoBuffers, but the compression filter treats them > as if they were: > + public void messageReceived(NextFilter nextFilter, IoSession session, > Object message) throws Exception { > + // Ignore control messages e.g. from SSL filter > + boolean compress = compressInbound && (message instanceof IoBuffer); > + > + if (!compress) { > Patch file will be attached... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.