From 2391a436e60b4a1823be983583d5ef34a7faf6de Mon Sep 17 00:00:00 2001 From: Hadriel Kaplan Date: Wed, 24 Dec 2014 15:04:01 -0500 Subject: 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 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Hadriel Kaplan Tested-by: Hadriel Kaplan --- epan/packet.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'epan/packet.c') 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 */ -- cgit v1.2.1