security: Fix some typos and potential NULL-deref
This patch against the git tree fixes minor typos, some of them possibily
leading to NULL-pointer dereference in rare conditions.
Signed-off-by: Remi Gacogne <rgacogne-github@coredump.fr>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Acked-by: Feng Lu <lu.feng@6wind.com>
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index a23b4f2..7e7c84f 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -164,7 +164,8 @@
new->nexthop = nexthop;
new->tag = 0;
- rn->info = new;
+ if (rn)
+ rn->info = new;
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
zlog_debug ("Redistribute[%s]: %s/%d external info created.",
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 587564a..c605ce6 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -1036,7 +1036,8 @@
/* If the lsa's age reached to MaxAge, start flushing procedure. */
if (IS_LSA_MAXAGE (lsa))
{
- lp->flags &= ~LPFLG_LSA_ENGAGED;
+ if (lp)
+ lp->flags &= ~LPFLG_LSA_ENGAGED;
ospf_opaque_lsa_flush_schedule (lsa);
goto out;
}