]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: don't call strtol on null pointer
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 8 Nov 2016 20:42:30 +0000 (20:42 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 8 Nov 2016 20:42:30 +0000 (20:42 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_vty.c

index f9d845dcd1534678916dcb09ffaea6fef819e31c..0203f3647d52185a6d30954fa418623f413d7742 100644 (file)
@@ -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);