diff options
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | netifaces.c | 5 |
2 files changed, 5 insertions, 2 deletions
@@ -8,7 +8,7 @@ netifaces 0.10.8 +-------------+------------------+ .. |BuildStatus| image:: https://travis-ci.org/al45tair/netifaces.svg?branch=master - :target: https://travis-ci.org/al45tair/dmgbuild + :target: https://travis-ci.org/al45tair/netifaces :alt: Build Status (Linux/Mac) .. |WinBuildStatus| image:: https://ci.appveyor.com/api/projects/status/3ctn1bl0aigpfjoo/branch/master?svg=true diff --git a/netifaces.c b/netifaces.c index fa18add..c73d14b 100644 --- a/netifaces.c +++ b/netifaces.c @@ -1024,7 +1024,7 @@ ifaddrs (PyObject *self, PyObject *args) char buffer[256]; PyObject *pyaddr = NULL, *netmask = NULL, *braddr = NULL, *flags = NULL; - if (strcmp (addr->ifa_name, ifname) != 0) + if (addr->ifa_name == NULL || strcmp (addr->ifa_name, ifname) != 0) continue; /* We mark the interface as found, even if there are no addresses; @@ -1357,6 +1357,9 @@ interfaces (PyObject *self) } for (addr = addrs; addr; addr = addr->ifa_next) { + if (addr->ifa_name == NULL) + continue; + if (!prev_name || strncmp (addr->ifa_name, prev_name, IFNAMSIZ) != 0) { PyObject *ifname = PyUnicode_FromString (addr->ifa_name); |