directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trustin Lee (JIRA)" <>
Subject [jira] Created: (DIRMINA-141) Infinite loop in ByteBuffer.get/putString()
Date Wed, 07 Dec 2005 12:37:08 GMT
Infinite loop in ByteBuffer.get/putString()

         Key: DIRMINA-141
     Project: Directory MINA
        Type: Bug
    Versions: 0.8.1, 0.8    
    Reporter: Trustin Lee
 Assigned to: Trustin Lee 
     Fix For: 0.8.2

expectedLength local variable in ByteBuffer.get/putString() is sometimes calculated as '0',
and it causes infinite loop in case of buffer overflow:

int expectedLength = (int) (in.remaining() * encoder.averageBytesPerChar());

This problem can be fixed easily by adding 1 to expectedLength:

int expectedLength = (int) (in.remaining() * encoder.averageBytesPerChar()) + 1;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message