Skip to content

Commit 94ff260

Browse files
author
David Sommerseth
committed
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>
1 parent c7f8c02 commit 94ff260

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python-ethtool/etherinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static void callback_nl_link(struct nl_object *obj, void *arg)
147147
unsigned char *binaddr;
148148
char hwaddr[130], *ptr;
149149

150-
if( (ethi == NULL) || (ethi->hwaddress != NULL) ) {
150+
if( (ethi == NULL) || (ethi->hwaddress != NULL) || (addr == NULL) ) {
151151
return;
152152
}
153153

0 commit comments

Comments
 (0)