On Mar 7, 2006, at 4:32 PM, peter royal (JIRA) wrote:
ByteBuffer.putString() can loop endlessly with multi-byte UTF-8 characters ---------------------------------------------------------------------- ----

         Key: DIRMINA-186
         URL: http://issues.apache.org/jira/browse/DIRMINA-186
     Project: Directory MINA
        Type: Bug
    Versions: 0.9.1
    Reporter: peter royal
    Priority: Critical


If the ByteBuffer is sized just-right, attempting to put a multi- byte UTF-8 character will cause the code to loop endlessly.

Attached is a test that will illustrate the issue, and a patch that first expands by the avgBytePerChar, then maxBytePerChar, then bails, to avoid a hang.

After too many repeated attempts JIRA will not let me attach files. So here they are:
-pete

Attachment: ByteBufferTest.diff
Description: Binary data

Attachment: ByteBuffer.diff
Description: Binary data


--
[EMAIL PROTECTED] - http://fotap.org/~osi


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to