bgpd: null check (Coverity 1472237)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
F. Aragon 2018-08-03 15:23:26 +02:00
parent 25f5f03987
commit 9f134cdcfd
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A

View File

@ -144,9 +144,6 @@ void bgp_table_range_lookup(const struct bgp_table *table, struct prefix *p,
struct bgp_node *node = bgp_node_from_rnode(table->route_table->top);
struct bgp_node *matched = NULL;
if (node == NULL)
return;
while (node && node->p.prefixlen <= p->prefixlen
&& prefix_match(&node->p, p)) {
if (node->info && node->p.prefixlen == p->prefixlen) {
@ -157,6 +154,9 @@ void bgp_table_range_lookup(const struct bgp_table *table, struct prefix *p,
&p->u.prefix, node->p.prefixlen)]);
}
if (node == NULL)
return;
if ((matched == NULL && node->p.prefixlen > maxlen) || !node->parent)
return;
else if (matched == NULL)