Merge pull request #2506 from pacovn/Coverity_1221453_1461297_Dereference_after_null_check

bgpd ospf6d: null check (Coverity 1221453 1461297)
This commit is contained in:
Donald Sharp 2018-06-21 07:26:47 -04:00 committed by GitHub
commit 07caaf613a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -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) {

View File

@ -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))