]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Clean up some SA issues found by new code
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 14 Feb 2018 04:39:09 +0000 (23:39 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 14 Feb 2018 04:41:31 +0000 (23:41 -0500)
1) Add asserts in a couple of spots to show we
never expect prefix to be bad.
2) Fix some bfd code where out_ctxt will
always be NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_ptm.c
zebra/zebra_vty.c

index 7f5fd472f1f96d5ae839ca3bf25c659a36143cbe..187c2594adc1568dec7db3db5f72db6393ddd447 100644 (file)
@@ -1007,8 +1007,13 @@ int zebra_ptm_bfd_client_register(struct zserv *client,
        return 0;
 
 stream_failure:
-       if (out_ctxt)
-               ptm_lib_cleanup_msg(ptm_hdl, out_ctxt);
+       /*
+        * IF we ever add more STREAM_GETXXX functions after the out_ctxt
+        * is allocated then we need to add this code back in
+        *
+        * if (out_ctxt)
+        *      ptm_lib_cleanup_msg(ptm_hdl, out_ctxt);
+        */
        return 0;
 }
 
index f5ad9c1c8acef47400d2560ca26465067e6c186f..269244f7688dec1f72bd89407b46503c1f8cc41a 100644 (file)
@@ -458,6 +458,12 @@ DEFPY(ip_route_blackhole_vrf,
        VTY_DECLVAR_CONTEXT(vrf, vrf);
        struct zebra_vrf *zvrf = vrf->info;
 
+       /*
+        * Coverity is complaining that prefix could
+        * be dereferenced, but we know that prefix will
+        * valid.  Add an assert to make it happy
+        */
+       assert(prefix);
        return zebra_static_route_leak(vty, zvrf, zvrf,
                                       AFI_IP, SAFI_UNICAST, no, prefix,
                                       mask_str, NULL, NULL, NULL, flag,
@@ -2014,6 +2020,12 @@ DEFPY(ipv6_route_blackhole_vrf,
        VTY_DECLVAR_CONTEXT(vrf, vrf);
        struct zebra_vrf *zvrf = vrf->info;
 
+       /*
+        * Coverity is complaining that prefix could
+        * be dereferenced, but we know that prefix will
+        * valid.  Add an assert to make it happy
+        */
+       assert(prefix);
        return zebra_static_route_leak(vty, zvrf, zvrf,
                                       AFI_IP6, SAFI_UNICAST, no, prefix_str,
                                       NULL, from_str, NULL, NULL, flag,