bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Potential segmentation fault in ifconfig


From: Alfred M. Szmidt
Subject: Re: [bug-inetutils] Potential segmentation fault in ifconfig
Date: Sat, 31 Jul 2010 07:32:19 -0400

Good catch, does the following work?

2010-07-31  Alfred M. Szmidt  <address@hidden>

        * ifconfig/options.c (parse_cmdline): Error out if IFNX is NULL.

@@ -589,8 +587,9 @@ parse_cmdline (int argc, char *argv[])
     {
       /* No interfaces specified.  Get a list of all interfaces.  */
       struct if_nameindex *ifnx, *ifnxp;
-
       ifnx = ifnxp = if_nameindex ();
+      if (!ifnx)
+       error (EXIT_FAILURE, 0, "could not get list of interfaces");
       while (ifnxp->if_index != 0 || ifnxp->if_name != NULL)
        {
          struct ifconfig *ifp;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]