From 4c9dee98789834e86b8649b9c1c162860b698f35 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Tue, 8 Nov 2016 20:42:30 +0000 Subject: [PATCH] bgpd: don't call strtol on null pointer Signed-off-by: Quentin Young --- bgpd/bgp_vty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index f9d845dcd1..0203f3647d 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1007,7 +1007,7 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths, u_int16_t options, int set) { struct bgp *bgp; - u_int16_t maxpaths = strtol(mpaths, NULL, 10); + u_int16_t maxpaths = 0; int ret; afi_t afi; safi_t safi; @@ -1017,7 +1017,10 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths, safi = bgp_node_safi (vty); if (set) + { + strtol(mpaths, NULL, 10); ret = bgp_maximum_paths_set (bgp, afi, safi, peer_type, maxpaths, options); + } else ret = bgp_maximum_paths_unset (bgp, afi, safi, peer_type); -- 2.39.5