Menu

#22 SignalPdu.java unmarshal buffer-underrun [fix included]

v1.0_(example)
open
nobody
None
1
2014-07-30
2013-10-28
Anonymous
No

Buffer Underrun: In src/main/edu/nps/moves/dis/SignalPdu.java the unmarshal call is incorrectly interpreting "dataLength" as a byte value instead of a bit value, and thus attempting to unmarshal 8x too many one-byte-chunks.

In order to fix the code the for loop was changed to:
for(int idx = 0; idx < dataLength; idx += 8)

Suggested changes would be either dataLength = dis.readShort() / 8; or the for loop changed as above.

Discussion

  • Anonymous

    Anonymous - 2013-10-28

    Update: This problem also exists in the Other Unmarshal call as well as in the marshal call.

     
  • Anonymous

    Anonymous - 2014-02-25

    I submitted this way back when. Is there no plan to fix this?

     
  • Peter Smith

    Peter Smith - 2014-02-25

    I agree the field is a bit value. In the C# code the array was handled correctly. Problem only exists in the Java version.

     
  • Anonymous

    Anonymous - 2014-06-25

    Does anybody actually update or even work on this code any longer???

     
  • Jeef

    Jeef - 2014-07-30

    Is this going to be fixed???

     
MongoDB Logo MongoDB