]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wireshark-pidl: Fix filter names for subcontext length fields
authorJohn Thacker <johnthacker@gmail.com>
Sun, 12 Oct 2025 19:11:39 +0000 (15:11 -0400)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 5 Nov 2025 10:08:28 +0000 (10:08 +0000)
From the Wireshark development branch:

    commit e3d8636109182d7e243eea6216af7f14edda3227
    Author: John Thacker <johnthacker@gmail.com>
    Date:   Thu Oct 9 20:06:43 2025 -0400

        pidl: Fix filter names for subcontext length fields

        The Perl variable $_->{NAME} never exists at the point in the code;
        $e->{NAME} is almost surely intended instead, which makes the subcontext
        length field have the same filter name as the parent field with
        ".subcontext" added.

        This changes a few fields, including making some fields in the same
        struct or union that incorrectly shared a filter name now have unique
        filter names. Also prevents Perl warnings:

        Use of uninitialized value in concatenation (.) or string at /builds/wireshark/wireshark/tools/pid
    l/lib/Parse/Pidl/Wireshark/NDR.pm line 438.

Signed-off-by: John Thacker <johnthacker@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 667199ecbd58909cdc8a31a87eb11f930eeb262f..ce0010acc98a41fc21b65a7ed37f8045dd0854fa 100644 (file)
@@ -410,7 +410,7 @@ sub ElementLevel($$$$$$$$)
                        $varswitch = $e->{PROPERTIES}->{switch_is};
                }
                my $num_bits = ($l->{HEADER_SIZE}*8);
-               my $hf2 = $self->register_hf_field($hf."_", "Subcontext length", "$ifname.$pn.$_->{NAME}subcontext", "FT_UINT$num_bits", "BASE_HEX", "NULL", 0, "");
+               my $hf2 = $self->register_hf_field($hf."_", "Subcontext length", "$ifname.$pn.$e->{NAME}.subcontext", "FT_UINT$num_bits", "BASE_HEX", "NULL", 0, "");
                $num_bits = 3264 if ($num_bits == 32);
                $self->{hf_used}->{$hf2} = 1;
                $self->pidl_code("guint$num_bits size;");