From 94ff260f3a69546c948f98530e534235dc60d1ac Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Tue, 21 Dec 2010 18:30:50 +0100 Subject: 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 --- python-ethtool/etherinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit