pidl/ws: fix Assigned value is garbage or undefined found by Clang Analyzer
authorAurelien Aptel <aaptel@suse.com>
Fri, 5 Feb 2016 14:29:28 +0000 (15:29 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 20 Jun 2016 10:08:20 +0000 (12:08 +0200)
Port Wireshark commit 683d657

Author: Alexis La Goutte <alexis.lagoutte@gmail.com>
Date:   Sun Oct 5 19:27:15 2014 +0200

    PIDL (DCERPC): fix Assigned value is garbage or undefined found by Clang Analyzer

    packet-dcerpc-dnsserver.c:1002:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-frstrans.c:1137:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-lsa.c:6345:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-nspi.c:7805:12: warning: Assigned value is garbage or undefined
    packet-dcerpc-dfs.c:3245:11: warning: Function call argument is an uninitialized value
    packet-dcerpc-dfs.c:3245:9: warning: 'level' may be used uninitialized in this function [-Wmaybe-uninitialized]

    Change-Id: Ife6a2f565ae215535d0e3d72ef50800114240e3f
    Reviewed-on: https://code.wireshark.org/review/4478
Reviewed-by: Evan Huus <eapache@gmail.com>
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 40c59c9..632f094 100644 (file)
@@ -661,7 +661,7 @@ sub Struct($$$$)
                        }
                        my $switch_type = "g${switch_raw_type}";
 
-                       push @$vars, "$switch_type $v;";
+                       push @$vars, "$switch_type $v = 0;";
                        $switch_info = [ $_->{TYPE}, $v ];
                        $varswitchs->{$v} = $switch_info;
                }