]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pidl:Wireshark Fix the type of array of pointerse to hf_ values
authorJohn Thacker <johnthacker@gmail.com>
Tue, 25 Jun 2024 22:40:20 +0000 (18:40 -0400)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 3 Jul 2024 02:35:43 +0000 (02:35 +0000)
Picked from Wireshark's fork:

    commit e1d9a226a2b8f2824a0eb162a8dc972e6e6c2dd4
    Author: Guy Harris <gharris@sonic.net>
    Date:   Thu Jun 18 18:14:46 2020 -0700

        Fix the type of arrays of pointers to hf_ values for bitfield routines.

        The static arrays are supposed to be arrays of const pointers to int,
        not arrays of non-const pointers to const int.

        Fixing that means some bugs (scribbling on what's *supposed* to be a
        const array) will be caught (see packet-ieee80211-radiotap.c for
        examples, the first of which inspired this change and the second of
        which was discovered while testing compiles with this change), and
        removes the need for some annoying casts.

        Also make some of those arrays static while we're at it.

        Update documentation and dissector-generator tools.

        Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
        Reviewed-on: https://code.wireshark.org/review/37517
        Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Signed-off-by: John Thacker <johnthacker@gmail.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Jul  3 02:35:43 UTC 2024 on atb-devel-224

pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index f5484ca734db42902c9c71c7ce3b0e8655aeb582..05ef8b78554fa8ff805e4c55e875d253ae6eb49f 100644 (file)
@@ -219,7 +219,7 @@ sub Bitmap($$$$)
        }
        if ($element_count > 0) {
                $self->pidl_code("proto_item *item;");
-               $self->pidl_code("static const int * $ifname\_$name\_fields[] = {");
+               $self->pidl_code("static int * const $ifname\_$name\_fields[] = {");
                $self->indent;
                foreach (@{$e->{ELEMENTS}}) {
                        next unless (/([^ ]*) (.*)/);