Wireshark-commits: [Wireshark-commits] master-2.6 ce62875: file: do not perform recursive redissect
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 28 Jun 2018 23:25:57 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=ce62875ce7c42681fbf05a79ba15598c7300afcc
Submitter: Roland Knall (rknall@xxxxxxxxx)
Changed: branch: master-2.6
Repository: wireshark

Commits:

ce62875 by Peter Wu (peter@xxxxxxxxxxxxx):

    file: do not perform recursive redissections to avoid crashes
    
    When packets are being read (in "cf_read") or rescanned/redissected (in
    "rescan_packets"), it could call "update_progress_dlg". That could end
    up accepting GUI actions such as changing profiles (which triggers a
    redissection via "cf_redissect_packets") or changing the display filter
    (which triggers another "rescan_packets" via "cf_filter_packets").
    
    Such recursive calls waste CPU and in case of "cf_redissect_packets" it
    also causes memory corruption (since "cf->epan" is destroyed while
    "cf_read" tries to read and process packets).
    
    Fix this by delaying the rescan/redissection when an existing rescan is
    pending. Abort an existing rescan/redissection if a new redissection
    (due to profile changes) or rescan (due to display filter changes) is
    requested and restart this to ensure that the intended user action is
    applied (such as a new display filter).
    
    Bug: 14918
    Change-Id: I646730f639b20aa9ec35306e3f11bf22f5923786
    Reviewed-on: https://code.wireshark.org/review/28500
    Petri-Dish: Anders Broman <a.broman58@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    (cherry picked from commit 8e07b778f6a79b17e905f52e5e0e8c9187c091bd)
    Reviewed-on: https://code.wireshark.org/review/28527
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Reviewed-by: Roland Knall <rknall@xxxxxxxxx>
    

Actions performed:

    from  d43ce7a   Fix indentation.
    adds  ce62875   file: do not perform recursive redissections to avoid crashes


Summary of changes:
 cfile.h |  8 ++++++++
 file.c  | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 63 insertions(+), 7 deletions(-)