Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-297

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 1.0.0
    • 1.0.2
    • None
    • None
    • windows IBM jdk 1.4 , sun JDK 1.5

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            gasser Gasser M. Abdallah
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: