Wireshark-commits: [Wireshark-commits] master aecb143: tcp: fix Follow TCP Stream for overlapping d

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 06 Jul 2018 07:26:44 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=aecb143e2c704d0b59b15420f60f780927fe7438
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

aecb143 by Peter Wu (peter@xxxxxxxxxxxxx):

    tcp: fix Follow TCP Stream for overlapping data
    
    When two segments overlap each other, previously the second segment
    would wrongly be appended to the first one while it should only append a
    subset from the end of the second segment. (It is assumed that the very
    first segment is received in time such that an extension on both the
    left and right side of the previous stream is not possible.)
    
    Make sure that "frag_follow_record->data" uses a subset (starting at the
    end of the previous stream) instead of the full tvb contents. While at
    it, add some documentation and restructure the logic to avoid code
    duplication and unnecessary memory allocations.
    
    (From bug 9882:) Tested with hao123-com_packet-injection-filtered.pcap,
    it now ignores the new overlapping data. Likewise for overlap-2.pcap.
    Tested with retransmission_with_additional_payload.pcapng (bug 13700).
    Unfortunately, there is no extra expert info to warn about the
    non-matching overlapping segment data, but that is a separate issue.
    
    Bug: 13700
    Change-Id: I74a941199d75b23b5d297e4dd534680ae610627d
    Reviewed-on: https://code.wireshark.org/review/28597
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  079d1521  tcp: fix Follow TCP Stream with missing (but ACKed) segments
    adds  aecb143   tcp: fix Follow TCP Stream for overlapping data


Summary of changes:
 epan/dissectors/packet-tcp.c | 117 ++++++++++++++++++++++---------------------
 1 file changed, 61 insertions(+), 56 deletions(-)