ObjectSerializationInputStream readObject is having wrong limit size leading to 
java.nio.BufferUnderflowException
-----------------------------------------------------------------------------------------------------------------

                 Key: DIRMINA-297
                 URL: http://issues.apache.org/jira/browse/DIRMINA-297
             Project: Directory MINA
          Issue Type: Bug
    Affects Versions: 1.0
         Environment: windows IBM jdk 1.4 , sun JDK 1.5
            Reporter: Gasser M. Abdallah
            Priority: Blocker


When trying to read an object from a classic client using the 
ObjectSerializationInputStream,  I faced java.nio.BufferUnderflowException,
I reviewed the ObjectSerializationInputStream.readObject() code and found that 
the problem is in the line:
                 
                            buf.limit( objectSize );

because the buffer limit should be set the objectSize + 4 ( four bytes for 
writing the size before the object bytes itself )
so I made a simple change => "buf.limit( objectSize  + 4);"

and everything went ok, therefore i believe this modification should be added 
to your next release.
Regards,
Gasser




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to