From 796ba7f1e59883a85558996ea7785054ae45aac0 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 7 Dec 2011 19:10:11 +0100 Subject: prevent 'netstat -nr -A inet6' from smashing stack (RHBZ #668047) --- lib/inet6_gr.c | 2 +- lib/inet_gr.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c index 2b055f6..a136231 100644 --- a/lib/inet6_gr.c +++ b/lib/inet6_gr.c @@ -82,7 +82,7 @@ int rprint_fib6(int ext, int numeric) "Flag Met Ref Use If\n")); while (fgets(buff, 1023, fp)) { - num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n", + num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %15s\n", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7], &prefix_len, diff --git a/lib/inet_gr.c b/lib/inet_gr.c index 84d8406..332bf92 100644 --- a/lib/inet_gr.c +++ b/lib/inet_gr.c @@ -68,7 +68,7 @@ int rprint_fib(int ext, int numeric) mss = 0; fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp, - "Iface", "%16s", + "Iface", "%15s", "Destination", "%127s", "Gateway", "%127s", "Flags", "%X", @@ -80,7 +80,7 @@ int rprint_fib(int ext, int numeric) "Window", "%d", "IRTT", "%d", NULL); - /* "%16s %127s %127s %X %d %d %d %127s %d %d %d\n" */ + /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */ if (!fmt) return 1; @@ -268,7 +268,7 @@ int rprint_cache(int ext, int numeric) "MSS Window irtt HH Arp\n")); fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, - "Iface", "%16s", + "Iface", "%15s", "Destination", "%127s", "Gateway", "%127s", "Flags", "%X", @@ -282,7 +282,7 @@ int rprint_cache(int ext, int numeric) "HH", "%d", "ARP", "%d", NULL); - /* "%16s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */ + /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */ } if (format == 2) { @@ -291,7 +291,7 @@ int rprint_cache(int ext, int numeric) "Flags Metric Ref Use Iface " "MSS Window irtt TOS HHRef HHUptod SpecDst\n")); fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp, - "Iface", "%16s", + "Iface", "%15s", "Destination", "%127s", "Gateway", "%127s", "Flags", "%X", @@ -307,7 +307,7 @@ int rprint_cache(int ext, int numeric) "HHUptod", "%d", "SpecDst", "%127s", NULL); - /* "%16s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */ + /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */ } -- cgit v1.2.3