diff options
author | 2008-10-02 23:31:04 +0000 | |
---|---|---|
committer | 2008-10-02 23:31:04 +0000 | |
commit | 188a83fae37ea872ad150527e330795d3cb83533 (patch) | |
tree | eeb81adf8f04f345578668d92bc62d919b561a49 | |
parent | Fix hypen in man pages (Debian Bug#288343 from Andrew Moise) (diff) | |
download | net-tools-188a83fae37ea872ad150527e330795d3cb83533.tar.gz net-tools-188a83fae37ea872ad150527e330795d3cb83533.tar.bz2 net-tools-188a83fae37ea872ad150527e330795d3cb83533.zip |
Avoid segfault of ifconfig(8) on missing /proc/net/dev
(Debian Bug #222209 Pierre Lombard, Tollef Fog Heen)
-rw-r--r-- | ifconfig.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3,7 +3,7 @@ * that either displays or sets the characteristics of * one or more of the system's networking interfaces. * - * Version: $Id: ifconfig.c,v 1.57 2002/12/10 00:56:41 ecki Exp $ + * Version: $Id: ifconfig.c,v 1.58 2008/10/02 23:31:04 ecki Exp $ * * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> * and others. Copyright 1993 MicroWalt Corporation @@ -112,6 +112,9 @@ static int if_print(char *ifname) struct interface *ife; ife = lookup_interface(ifname); + if (!ife) { + return -1; + } res = do_if_fetch(ife); if (res >= 0) ife_print(ife); |