summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2010-12-21 18:30:50 +0100
committerDavid Sommerseth <davids@redhat.com>2010-12-21 18:30:50 +0100
commit94ff260f3a69546c948f98530e534235dc60d1ac (patch)
tree9f2b011b9160aa44ed35dc7c225d3725a3147df8
parentc7f8c02f92af5a4b7a1c294c38e5477918ef3f87 (diff)
downloadpython-ethtool-94ff260f3a69546c948f98530e534235dc60d1ac.tar.gz
python-ethtool-94ff260f3a69546c948f98530e534235dc60d1ac.tar.xz
python-ethtool-94ff260f3a69546c948f98530e534235dc60d1ac.zip
Don't segfault if we don't receive any address from rtnl_link_get_addr()
The callback function for device link information was lacking a simple check to avoid a SEGV in these situations. Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r--python-ethtool/etherinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/python-ethtool/etherinfo.c b/python-ethtool/etherinfo.c
index 41a55fe..3350cf9 100644
--- a/python-ethtool/etherinfo.c
+++ b/python-ethtool/etherinfo.c
@@ -147,7 +147,7 @@ static void callback_nl_link(struct nl_object *obj, void *arg)
unsigned char *binaddr;
char hwaddr[130], *ptr;
- if( (ethi == NULL) || (ethi->hwaddress != NULL) ) {
+ if( (ethi == NULL) || (ethi->hwaddress != NULL) || (addr == NULL) ) {
return;
}