mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 23:54:45 +00:00
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>
This commit is contained in:
parent
b52aef18a9
commit
a11e012e86
@ -1856,9 +1856,11 @@ vty_serv_sock_family (const char* addr, unsigned short port, int family)
|
|||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
naddr=&su.sin.sin_addr;
|
naddr=&su.sin.sin_addr;
|
||||||
|
break;
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
naddr=&su.sin6.sin6_addr;
|
naddr=&su.sin6.sin6_addr;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ ospfv3AreaEntry (struct variable *v, oid *name, size_t *length,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
len = *length - v->namelen;
|
len = *length - v->namelen;
|
||||||
len = (len >= 1 ? sizeof 1 : 0);
|
len = (len >= 1 ? 1 : 0);
|
||||||
if (exact && len != 1)
|
if (exact && len != 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (len)
|
if (len)
|
||||||
|
@ -164,7 +164,8 @@ ospf_external_info_add (u_char type, struct prefix_ipv4 p,
|
|||||||
new->nexthop = nexthop;
|
new->nexthop = nexthop;
|
||||||
new->tag = 0;
|
new->tag = 0;
|
||||||
|
|
||||||
rn->info = new;
|
if (rn)
|
||||||
|
rn->info = new;
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
zlog_debug ("Redistribute[%s]: %s/%d external info created.",
|
zlog_debug ("Redistribute[%s]: %s/%d external info created.",
|
||||||
|
@ -1036,7 +1036,8 @@ ospf_mpls_te_lsa_refresh (struct ospf_lsa *lsa)
|
|||||||
/* If the lsa's age reached to MaxAge, start flushing procedure. */
|
/* If the lsa's age reached to MaxAge, start flushing procedure. */
|
||||||
if (IS_LSA_MAXAGE (lsa))
|
if (IS_LSA_MAXAGE (lsa))
|
||||||
{
|
{
|
||||||
lp->flags &= ~LPFLG_LSA_ENGAGED;
|
if (lp)
|
||||||
|
lp->flags &= ~LPFLG_LSA_ENGAGED;
|
||||||
ospf_opaque_lsa_flush_schedule (lsa);
|
ospf_opaque_lsa_flush_schedule (lsa);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,7 @@ send_packet(struct interface *ifp,
|
|||||||
if (!(ifp->flags & IFF_UP))
|
if (!(ifp->flags & IFF_UP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!p)
|
if (p)
|
||||||
src = ntohl(p->u.prefix4.s_addr);
|
src = ntohl(p->u.prefix4.s_addr);
|
||||||
else
|
else
|
||||||
src = 0; /* Is filled in */
|
src = 0; /* Is filled in */
|
||||||
|
Loading…
Reference in New Issue
Block a user