Commit f7e04983 authored by Ilya's avatar Ilya
Browse files

resolve possible null pointer dereference

issue found by clang static analyzer

../../../proto/ospf/topology.c:287:13: warning: Dereference of null pointer
        p->p.name, lsa->nf->fn.prefix, lsa->nf->fn.pxlen);
                   ^~~~~~~~~~~~~~~~~~
parent 4c0b741b
......@@ -283,8 +283,11 @@ ospf_originate_lsa(struct ospf_proto *p, struct ospf_new_lsa *lsa)
if (en->nf != lsa->nf)
{
log(L_ERR "%s: LSA ID collision for %I/%d",
p->p.name, lsa->nf->fn.prefix, lsa->nf->fn.pxlen);
if(lsa != NULL)
{
log(L_ERR "%s: LSA ID collision for %I/%d",
p->p.name, lsa->nf->fn.prefix, lsa->nf->fn.pxlen);
}
en = NULL;
goto drop;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment