From 8add39743bbbf6b94677ce1bc5037076d86e2098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Vok=C3=A1l?= Date: Tue, 27 Mar 2007 07:33:10 +0000 Subject: [PATCH] - fix segfault for empty interface (#234045) --- net-tools-1.60-netstat-interfaces-crash.patch | 25 +++++++++++++++++++ net-tools.spec | 7 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 net-tools-1.60-netstat-interfaces-crash.patch diff --git a/net-tools-1.60-netstat-interfaces-crash.patch b/net-tools-1.60-netstat-interfaces-crash.patch new file mode 100644 index 0000000..bb99932 --- /dev/null +++ b/net-tools-1.60-netstat-interfaces-crash.patch @@ -0,0 +1,25 @@ +--- net-tools-1.60/netstat.c.old 2007-03-27 09:28:28.000000000 +0200 ++++ net-tools-1.60/netstat.c 2007-03-27 09:26:39.000000000 +0200 +@@ -2105,7 +2105,7 @@ + fprintf(stderr, _(" netstat { [-veenNac] -I[] | [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n")); + + fprintf(stderr, _(" -r, --route display routing table\n")); +- fprintf(stderr, _(" -I, --interfaces=[] display interface table for \n")); ++ fprintf(stderr, _(" -I, --interface=[] display interface table for \n")); + fprintf(stderr, _(" -i, --interfaces display interface table\n")); + fprintf(stderr, _(" -g, --groups display multicast group memberships\n")); + fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n")); +@@ -2234,7 +2234,12 @@ + case 'I': + if (optarg && strcmp(optarg, "(null)")) + if (optarg[0] == '=') optarg++; +- flag_int_name = strdup(optarg); ++ if (optarg && strcmp(optarg, "(null)")) ++ flag_int_name = strdup(optarg); ++ else { ++ usage(); ++ exit(1); ++ } + flag_int++; + break; + case 'i': diff --git a/net-tools.spec b/net-tools.spec index 757e547..147f7a0 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -3,7 +3,7 @@ Summary: Basic networking tools Name: net-tools Version: 1.60 -Release: 80%{?dist} +Release: 81%{?dist} License: GPL Group: System Environment/Base URL: http://www.tazenda.demon.co.uk/phil/net-tools/ @@ -72,6 +72,7 @@ Patch58: net-tools-1.60-nameif_strncpy.patch Patch59: net-tools-1.60-arp-unaligned-access.patch Patch60: net-tools-1.60-sctp-quiet.patch Patch61: net-tools-1.60-remove_node.patch +Patch62: net-tools-1.60-netstat-interfaces-crash.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(post): /sbin/chkconfig @@ -144,6 +145,7 @@ ifconfig, netstat, route, and others. %patch59 -p1 -b .arp-un-access %patch60 -p1 -b .quiet %patch61 -p1 +%patch62 -p1 -b .iface-crash cp %SOURCE2 ./config.h cp %SOURCE3 ./config.make @@ -259,6 +261,9 @@ exit 0 %{_sysconfdir}/rc.d/init.d/netplugd %changelog +* Tue Mar 27 2007 Radek Vokál - 1.60-81 +- fix segfault for empty interface (#234045) + * Thu Mar 15 2007 Radek Vokál - 1.60-80 - we don't have -n/--node option (#225554)