diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-14 05:39:09 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-14 05:41:31 +0100 |
commit | 6447dbb3726089659be4c891be8b2db39031791a (patch) | |
tree | f2bc5586c65c98344fa68ebc36c88ddd459f781a /zebra | |
parent | ospfd: Fix some new SA issues found by coverity (diff) | |
download | frr-6447dbb3726089659be4c891be8b2db39031791a.tar.xz frr-6447dbb3726089659be4c891be8b2db39031791a.zip |
zebra: Clean up some SA issues found by new code
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>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_ptm.c | 9 | ||||
-rw-r--r-- | zebra/zebra_vty.c | 12 |
2 files changed, 19 insertions, 2 deletions
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 7f5fd472f..187c2594a 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -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; } diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index f5ad9c1c8..269244f76 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -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, |