diff options
author | Hadriel Kaplan <hadriel@128technology.com> | 2014-12-24 15:04:01 -0500 |
---|---|---|
committer | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-12-25 15:13:56 +0000 |
commit | 2391a436e60b4a1823be983583d5ef34a7faf6de (patch) | |
tree | 612404c71d4777f37b65ef2f64d6d1e1a3285264 /epan/packet.c | |
parent | de8c81cd9235f97541db28b0eed6865bf3a6a291 (diff) |
Bug 10233 - Wireshark crashes if Lua heuristic dissector returns true
Because call_heur_dissector_direct() didn't set the pinfo->heur_list_name
before calling the heuristic dissector, heur_dissect_lua() would invoke
report_failure(). Unfortunately, calling report_failure() within a dissector
can cause problems because GTK continues invoking timed callbacks while
it displays the modal dialog created by report_failure()... without yet
returning from report_failure(). In such a case, it's possible for
epan_dissect_run() to be called while still within the execution of a
previous call to epan_dissect_run(), which casues an assert since
epan_dissect_run() is not reentrant.
So this commit both fixes the call_heur_dissector_direct() bug as well
as avoids using report_failure() within heur_dissect_lua(). It also
upadtes the dissector.lua script used in the testsuite to match the one
pubshied on the wiki, since that script's heuristic dissector triggered
the bug.
Bug: 10233
Change-Id: If022604347745fadac01c02d370ca1a5d3f88b5b
Reviewed-on: https://code.wireshark.org/review/6040
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
Diffstat (limited to 'epan/packet.c')
-rw-r--r-- | epan/packet.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/packet.c b/epan/packet.c index 155a3c6c72..a61f75260a 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -2462,6 +2462,8 @@ void call_heur_dissector_direct(heur_dtbl_entry_t *heur_dtbl_entry, tvbuff_t *tv wmem_list_append(pinfo->layers, GINT_TO_POINTER(proto_id)); } + pinfo->heur_list_name = heur_dtbl_entry->list_name; + EP_CHECK_CANARY(("before calling heuristic dissector for protocol: %s", proto_get_protocol_filter_name(proto_id))); /* call the dissector, as we have saved the result heuristic failure is an error */ |