]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Another call path with uninited data
authorDonald Sharp <sharpd@nvidia.com>
Wed, 5 May 2021 11:48:55 +0000 (07:48 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 5 May 2021 11:48:55 +0000 (07:48 -0400)
Prevent another call path that uses uninited data in
bgp_pbr.c

This was found through more clang sa runs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_pbr.c

index 8b27b39c46233d6ae761b21c33b6ee2c639ce52f..01443c778fc6e365a0d93f16cc04bf415ed43cfa 100644 (file)
@@ -2034,6 +2034,9 @@ static void bgp_pbr_icmp_action(struct bgp *bgp, struct bgp_path_info *path,
                return;
        if (bpf->protocol != IPPROTO_ICMP)
                return;
+
+       memset(&srcp, 0, sizeof(srcp));
+       memset(&dstp, 0, sizeof(dstp));
        bpf->src_port = &srcp;
        bpf->dst_port = &dstp;
        /* parse icmp type and lookup appropriate icmp code