Wireshark-commits: [Wireshark-commits] master a14e7a7: Avoid UAF after deregister_dissector

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 2 Apr 2016 23:00:31 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=a14e7a7ce19ea2cd0799ebca43d9eaf00aabb27d
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

a14e7a7 by Peter Wu (peter@xxxxxxxxxxxxx):

    Avoid UAF after deregister_dissector
    
    When deregister_dissector is called by Lua, the protocol was not
    property removed from the dependent dissectors list. Fix this and also
    duplicate the memory for keys and values since these strings might be
    dynamically allocated.
    
    Fixes a use-after-free after reloading Lua dissectors that use
    DissectorTable:add() and opening a new/closing an existing capture file.
    
    Change-Id: If2ae02f155e7ab8fc653c08003755897471f9be0
    Reviewed-on: https://code.wireshark.org/review/14735
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    

Actions performed:

    from  07f4258   Use AC_PROG_SED
    adds  a14e7a7   Avoid UAF after deregister_dissector


Summary of changes:
 epan/packet.c |   52 ++++++++++++++++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 18 deletions(-)