Wireshark-commits: [Wireshark-commits] master a1ecbc9: make proto_tree_add_bitmask_value_with_flags
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 23 Dec 2016 12:40:32 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=a1ecbc92b028203bd08db18585471050baf712f4
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

a1ecbc9 by Martin Kaiser (wireshark@xxxxxxxxx):

    make proto_tree_add_bitmask_value_with_flags() work for tvb==NULL
    
    proto_tree_add_bitmask_value_with_flags() eventually calls
    proto_tree_add_XXX() for the main hf and for the field elements.
    
    These functions work for tvb==NULL if the length is also set to 0.
    Otherwise, we'll end up in proto_tree_add_pi(), get_hfi_length() and
    run into the DISSECTOR_ASSERT() there.
    
    proto_tree_add_bitmask_value...() are meant for cases where the data is
    passed directly and not read from a tvb. If tvb==NULL, set our length to
    0 instead of using the field length from the main hf.
    
    Change-Id: Ia55b068e9842ba4a1ae8be8692320a8e93ea8631
    Reviewed-on: https://code.wireshark.org/review/19394
    Reviewed-by: Martin Kaiser <wireshark@xxxxxxxxx>
    Petri-Dish: Martin Kaiser <wireshark@xxxxxxxxx>
    Reviewed-by: Pascal Quantin <pascal.quantin@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    

Actions performed:

    from  46caff3   Qt: add local file existence check for extcap help.
    adds  a1ecbc9   make proto_tree_add_bitmask_value_with_flags() work for tvb==NULL


Summary of changes:
 epan/proto.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)