Wireshark-commits: [Wireshark-commits] master-3.2 ced2c83: radiotap: make tables that we modify aut
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=ced2c83ee89501bf853f2ade4a820eaecf393492
Submitter: "Guy Harris <gharris@xxxxxxxxx>"
Changed: branch: master-3.2
Repository: wireshark
Commits:
ced2c83 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>
(cherry picked from commit 7a526325e9568a0722798dc1f386576464744e77)
Reviewed-on: https://code.wireshark.org/review/37503
Actions performed:
from b9a631c radiotap: fix typo.
add ced2c83 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(-)