Wireshark-commits: [Wireshark-commits] master 7a52632: radiotap: make tables that we modify automat

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 18 Jun 2020 08:04:49 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=7a526325e9568a0722798dc1f386576464744e77
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

7a52632 by Guy Harris (gharris@xxxxxxxxx):

    radiotap: make tables that we modify automatic rather than static.
    
    The arrays of pointers to header field hf_ values were getting
    overwritten if the fields in question are unknown; that meant that, in
    all future dissections, they would be dissected as unknown *even for
    packets where they are known*.
    
    Make them auto arrays, instead, so that each call to the dissector has
    its own copy, properly initialized at run time, that it can scribble
    over as it chooses without damaging the array for the next call.
    
    This involves a cast to work around the type of the array argument being
    "const int **", which means "pointer to pointer to const int",
    not "pointer to const pointer to (non-const) int".  That meant that the
    scribbling on the static array was *not* detected at compile time.
    
    Fixing the type is a *lot* of work, but may catch other instances of
    this problem, and may prevent future instances of it.  That's a project
    for a separate commit, however.
    
    Bug: 16636
    Change-Id: I985157063488739bb59f87780c017e94e2380343
    Reviewed-on: https://code.wireshark.org/review/37502
    Petri-Dish: Guy Harris <gharris@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <gharris@xxxxxxxxx>
    

Actions performed:

    from  8b168e99  radiotap: fix typo.
     add  7a52632   radiotap: make tables that we modify automatic rather than static.


Summary of changes:
 epan/dissectors/packet-ieee80211-radiotap.c | 144 ++++++++++++++++------------
 1 file changed, 84 insertions(+), 60 deletions(-)