]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Sat, 2 Apr 2005 16:37:07 +0000 (16:37 +0000)
committerajs <ajs>
Sat, 2 Apr 2005 16:37:07 +0000 (16:37 +0000)
* ospf6_route.c: (ospf6_route_show, ospf6_route_show_detail) Protect
  against the possibility that the string returned by if_indextoname
  may not terminate with '\0'.

ospf6d/ChangeLog
ospf6d/ospf6_route.c

index 60519e64c4d30a473fca60d7b1a852d015f849bd..e0a5775b0381c2ce50150e42cba247b36a3cfa47 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * ospf6_route.c: (ospf6_route_show, ospf6_route_show_detail) Protect
+         against the possibility that the string returned by if_indextoname
+         may not terminate with '\0'.
+
 2005-03-02 Vincent Jardin <Vincent.Jardin@6wind.com>
 
        * ospf6_zebra.c: Fix core dump when router-id is provided with
index f39a1b39c009de121e4d7b532e1970e69df70131..521d8ade7697992bb5caf01dceeff8cd69846d01 100644 (file)
@@ -647,11 +647,11 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route)
   if (! if_indextoname (route->nexthop[0].ifindex, ifname))
     snprintf (ifname, sizeof (ifname), "%d", route->nexthop[0].ifindex);
 
-  vty_out (vty, "%c%1s %2s %-30s %-25s %6s %s%s",
+  vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s",
            (ospf6_route_is_best (route) ? '*' : ' '),
            OSPF6_DEST_TYPE_SUBSTR (route->type),
            OSPF6_PATH_TYPE_SUBSTR (route->path.type),
-           destination, nexthop, ifname, duration, VNL);
+           destination, nexthop, IFNAMSIZ, ifname, duration, VNL);
 
   for (i = 1; ospf6_nexthop_is_set (&route->nexthop[i]) &&
        i < OSPF6_MULTI_PATH_LIMIT; i++)
@@ -662,8 +662,8 @@ ospf6_route_show (struct vty *vty, struct ospf6_route *route)
       if (! if_indextoname (route->nexthop[i].ifindex, ifname))
         snprintf (ifname, sizeof (ifname), "%d", route->nexthop[i].ifindex);
 
-      vty_out (vty, "%c%1s %2s %-30s %-25s %6s %s%s",
-               ' ', "", "", "", nexthop, ifname, "", VNL);
+      vty_out (vty, "%c%1s %2s %-30s %-25s %6.*s %s%s",
+               ' ', "", "", "", nexthop, IFNAMSIZ, ifname, "", VNL);
     }
 }
 
@@ -758,7 +758,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route)
                  sizeof (nexthop));
       if (! if_indextoname (route->nexthop[i].ifindex, ifname))
         snprintf (ifname, sizeof (ifname), "%d", route->nexthop[i].ifindex);
-      vty_out (vty, "  %s %s%s", nexthop, ifname, VNL);
+      vty_out (vty, "  %s %.*s%s", nexthop, IFNAMSIZ, ifname, VNL);
     }
   vty_out (vty, "%s", VNL);
 }