Wireshark-commits: [Wireshark-commits] master-3.0 414d8c3: packet: ensure pinfo->curr_layer_num doe

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 22 Apr 2019 23:10:06 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=414d8c313c522698d1f29d8440fc6322dec476c1
Submitter: "Peter Wu <peter@xxxxxxxxxxxxx>"
Changed: branch: master-3.0
Repository: wireshark

Commits:

414d8c3 by Peter Wu (peter@xxxxxxxxxxxxx):

    packet: ensure pinfo->curr_layer_num does not depend on tree
    
    The TLS dissector relies on a stable value for pinfo->curr_layer_num
    between passes to enable handshake reassembly and decryption. A mismatch
    could occur if the subdissector accepted the data (len is non-zero), but
    did not add any tree items (tree->tree_data->count remains unchanged).
    
    The original change added the check for tree->tree_data->count in order
    to remove protocol names that are not visible in the tree. This could
    for example occur when the HTTP dissector accepts the data but requests
    more data for reassembly.
    
    This desire to hide protocols is understandable, so simply reverting the
    change would not be ok. Checking pinfo->desegment_offset is also not
    stable. So that leaves the current approach.
    
    Change-Id: I247adafbaa6d23ab9397eadacabaed9e1bfde997
    Ping-Bug: 15625
    Fixes: v2.5.0rc0-1206-gcd90f732a1 ("Improve frame.protocols accuracy.")
    Reviewed-on: https://code.wireshark.org/review/32919
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Pascal Quantin <pascal@xxxxxxxxxxxxx>
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    (cherry picked from commit 5076e53ffb2b39d5d9ac2dcf6f2fd626bf2cafd7)
    Reviewed-on: https://code.wireshark.org/review/32949
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  278b8eb   [Automatic update for 2019-04-21]
     add  414d8c3   packet: ensure pinfo->curr_layer_num does not depend on tree


Summary of changes:
 epan/packet.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)