summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-21 07:26:47 -0400
committerGitHub <noreply@github.com>2018-06-21 07:26:47 -0400
commit07caaf613a70d49cb002db221645a8d15edb1eee (patch)
treef21e112535cd736a352d80aea1a92f781113cec1
parent76cd18c9ddfbdb8f36b60fac61ebb4d64d12d079 (diff)
parentcac84a16112b4b8cd875391589e5226d601fa922 (diff)
Merge pull request #2506 from pacovn/Coverity_1221453_1461297_Dereference_after_null_check
bgpd ospf6d: null check (Coverity 1221453 1461297)
-rw-r--r--bgpd/rfapi/bgp_rfapi_cfg.c3
-rw-r--r--ospf6d/ospf6_spf.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c
index 72255e54fb..491741a35b 100644
--- a/bgpd/rfapi/bgp_rfapi_cfg.c
+++ b/bgpd/rfapi/bgp_rfapi_cfg.c
@@ -1426,7 +1426,8 @@ DEFUN (vnc_export_nvegroup,
if (rfg_new == NULL) {
rfg_new = bgp_rfapi_cfg_match_byname(bgp, argv[5]->arg,
RFAPI_GROUP_CFG_VRF);
- vnc_add_vrf_opener(bgp, rfg_new);
+ if (rfg_new)
+ vnc_add_vrf_opener(bgp, rfg_new);
}
if (rfg_new == NULL) {
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 28c3459825..5b6691e6bf 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -677,6 +677,10 @@ void ospf6_spf_schedule(struct ospf6 *ospf6, unsigned int reason)
{
unsigned long delay, elapsed, ht;
+ /* OSPF instance does not exist. */
+ if (ospf6 == NULL)
+ return;
+
ospf6_set_spf_reason(ospf6, reason);
if (IS_OSPF6_DEBUG_SPF(PROCESS) || IS_OSPF6_DEBUG_SPF(TIME)) {
@@ -686,10 +690,6 @@ void ospf6_spf_schedule(struct ospf6 *ospf6, unsigned int reason)
rbuf);
}
- /* OSPF instance does not exist. */
- if (ospf6 == NULL)
- return;
-
/* SPF calculation timer is already scheduled. */
if (ospf6->t_spf_calc) {
if (IS_OSPF6_DEBUG_SPF(PROCESS) || IS_OSPF6_DEBUG_SPF(TIME))