+2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * ospf_dump.h: Define OSPF_TIME_DUMP_SIZE as appropriate buffer size
+ for use with ospf_timer_dump and ospf_timeval_dump.
+ * ospf_vty.c: Change all buffer sizes used with ospf_timer_dump and
+ ospf_timeval_dump to have size OSPF_TIME_DUMP_SIZE.
+ (show_ip_ospf_interface_sub) Fix possible buffer overflow in
+ call to ospf_timer_dump.
+
2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_ism.h: (OSPF_ISM_TIMER_OFF) Improve macro syntax by enclosing
/* Stub-router state for this area */
if (CHECK_FLAG (area->stub_router_state, OSPF_AREA_IS_STUB_ROUTED))
{
- char timebuf[9];
+ char timebuf[OSPF_TIME_DUMP_SIZE];
vty_out (vty, " Originating stub / maximum-distance Router-LSA%s",
VTY_NEWLINE);
if (CHECK_FLAG(area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED))
struct ospf_area * area;
struct ospf *ospf;
struct timeval result;
- char timebuf[13]; /* XX:XX:XX.XXX(nul) */
+ char timebuf[OSPF_TIME_DUMP_SIZE];
/* Check OSPF is enable. */
ospf = ospf_lookup ();
int is_up;
struct ospf_neighbor *nbr;
struct route_node *rn;
- char buf[9];
/* Is interface up? */
vty_out (vty, "%s is %s%s", ifp->name,
if (OSPF_IF_PARAM (oi, passive_interface) == OSPF_IF_ACTIVE)
{
- int timer_slen = 9; /* length of "hh:mm:ss(nul)" */
-
- /* for fast hello we also want to see the .XXXX ms part */
- if (OSPF_IF_PARAM (oi, fast_hello))
- timer_slen += 5;
-
+ char timebuf[OSPF_TIME_DUMP_SIZE];
vty_out (vty, " Hello due in %s%s",
- ospf_timer_dump (oi->t_hello, buf, timer_slen),
+ ospf_timer_dump (oi->t_hello, timebuf, sizeof(timebuf)),
VTY_NEWLINE);
}
else /* OSPF_IF_PASSIVE is set */
struct route_node *rn;
struct ospf_neighbor *nbr;
char msgbuf[16];
- char timebuf[14];
+ char timebuf[OSPF_TIME_DUMP_SIZE];
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
if ((nbr = rn->info))
show_ip_ospf_nbr_nbma_detail_sub (struct vty *vty, struct ospf_interface *oi,
struct ospf_nbr_nbma *nbr_nbma)
{
- char timebuf[9];
+ char timebuf[OSPF_TIME_DUMP_SIZE];
/* Show neighbor ID. */
vty_out (vty, " Neighbor %s,", "-");
show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi,
struct ospf_neighbor *nbr)
{
- char timebuf[9];
+ char timebuf[OSPF_TIME_DUMP_SIZE];
/* Show neighbor ID. */
if (nbr->state == NSM_Attempt && nbr->router_id.s_addr == 0)