Wireshark-commits: [Wireshark-commits] master 8e07b77: file: do not perform recursive redissections
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=8e07b778f6a79b17e905f52e5e0e8c9187c091bd
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
8e07b77 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>
Actions performed:
from 411c5e9 Fix indentation.
adds 8e07b77 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(-)