Wireshark-commits: [Wireshark-commits] master 2391a43: Bug 10233 - Wireshark crashes if Lua heurist
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 25 Dec 2014 15:14:00 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2391a436e60b4a1823be983583d5ef34a7faf6de
Submitter: Hadriel Kaplan (hadrielk@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

2391a43 by Hadriel Kaplan (hadriel@xxxxxxxxxxxxxxxxx):

    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@xxxxxxxxxxxx>
    Petri-Dish: Michael Mann <mmann78@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Hadriel Kaplan <hadrielk@xxxxxxxxx>
    Tested-by: Hadriel Kaplan <hadrielk@xxxxxxxxx>
    

Actions performed:

    from  de8c81c   Use getopt_long().
    adds  2391a43   Bug 10233 - Wireshark crashes if Lua heuristic dissector returns true


Summary of changes:
 epan/packet.c           |    2 +
 epan/wslua/init_wslua.c |   22 ++++--
 test/lua/dissector.lua  |  183 +++++++++++++++++++++++++++++++++++++++--------
 3 files changed, 172 insertions(+), 35 deletions(-)