summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_vpn.c
diff options
context:
space:
mode:
authorpaco <paco@voltanet.io>2018-06-18 12:51:33 +0200
committerpaco <paco@voltanet.io>2018-06-18 12:51:33 +0200
commite105d9045619b9d5bb9c2d219af9f342e6f3549f (patch)
treefb0c4dfc4a4f349df8933cdd1c65529f4d8e1a4f /bgpd/bgp_vpn.c
parentMerge pull request #2458 from pacovn/Coverity_1221437_Unchecked_return_value (diff)
downloadfrr-e105d9045619b9d5bb9c2d219af9f342e6f3549f.tar.xz
frr-e105d9045619b9d5bb9c2d219af9f342e6f3549f.zip
bgpd: null check (Coverity 1408766)
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to 'bgpd/bgp_vpn.c')
-rw-r--r--bgpd/bgp_vpn.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/bgpd/bgp_vpn.c b/bgpd/bgp_vpn.c
index 80bd2cd79..351f91dd1 100644
--- a/bgpd/bgp_vpn.c
+++ b/bgpd/bgp_vpn.c
@@ -228,15 +228,13 @@ int show_adj_route_vpn(struct vty *vty, struct peer *peer,
use_json, json_array);
}
}
- if (use_json) {
- struct prefix *p;
+ if (use_json && rm) {
char buf_a[BUFSIZ];
char buf_b[BUFSIZ];
- p = &rm->p;
sprintf(buf_a, "%s/%d",
- inet_ntop(p->family, &p->u.prefix,
+ inet_ntop(rm->p.family, rm->p.u.val,
buf_b, BUFSIZ),
- p->prefixlen);
+ rm->p.prefixlen);
json_object_object_add(json_routes, buf_a,
json_array);
}