Wireshark-commits: [Wireshark-commits] master 764b147: wslua: fail on tree:add(nil)

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 4 Jul 2016 16:26:55 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=764b147a7c604e7b718a48770ce010bf2ab6e5ea
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

764b147 by Peter Wu (peter@xxxxxxxxxxxxx):

    wslua: fail on tree:add(nil)
    
    It is unlikely that tree:add(nil) or tree:add(nil, tvb) represents a
    valid invocation. Most likely the developer made a mistake and tried
    something like:
    
        local pf_thing = ProtoField.string("some.thing", "Description")
        some_proto.fields = { pf_thing }
        ...
            tree:add(some_proto.fields.thing, tvb())
    
    which should have been:
    
        some_proto.fields = { thing = pf_thing }
    
    or:
    
            tree:add(pf_thing, tvb())
    
    Save the developer some pain and bail out early.
    
    Change-Id: I59fc04153f02bb186b47b763676a68bb0271df76
    Reviewed-on: https://code.wireshark.org/review/16177
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    

Actions performed:

    from  cf508f8   androiddump: fix leak (CID 1293387).
    adds  764b147   wslua: fail on tree:add(nil)


Summary of changes:
 epan/wslua/wslua_tree.c |    2 ++
 1 file changed, 2 insertions(+)