I've uploaded a new patch that checks the buffer overflow condition in the native wrap and unwrap. The testSelfInteraction test of org.apache.harmony.xnet.provider.jsse.SSLEngineImplTest now gets a bit further, though now fails reading on the second iteration of the wrap/unwrap data exchange loop. Oli - Do you get this behaviour on Windows? So I still see the same 4 test failures in that test at the moment.
Best wishes, Cath