Menu

#15 JPacket.transferTo doesn't copy the state information

Version 1.2
closed-fixed
API Issue (77)
7
2008-12-26
2008-11-28
No

JPacket.transferTo(JPacket) doesn't deep copy the state information to destination packet.

Discussion

  • Sly Technologies

    • status: open --> open-accepted
     
  • Sly Technologies

    I found the problem. The easy explanation is that function was only copying the packet state information and wasn't copying the array of header structures that reside right after the packet state structure.

    The complex answer is that packet state object is dynamic in size, depends how many headers have actually been discovered. The size is not properly recorded directly in the state object right after a scan. This way, even rescanning a packet will make sure that the header states are included as well.

    Anyway, the size of the packet state structure is now correctly recorded at the time of the scan (since there are variable number of headers present in the state structure).

     
  • Sly Technologies

    The issue has been fixed and will be released in the next major or maintenance release. The bug was found and confirmed. Appropriate jUnit test cases have been created to verify that this issue is resolved and will not be broken again by future changes.

     
  • Sly Technologies

    • status: open-accepted --> closed-fixed
     

Log in to post a comment.