From 3f669049e77b87cca9168fbd55838bd679b573c4 Mon Sep 17 00:00:00 2001 From: Håkon Nessjøen Date: Fri, 19 Nov 2010 01:52:54 +0100 Subject: Handle network devices without address information correctly. --- devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devices.c') diff --git a/devices.c b/devices.c index bb1822d..9fafdb7 100644 --- a/devices.c +++ b/devices.c @@ -124,7 +124,7 @@ int getIps(char *name, int nameLen, struct sockaddr_in *ip) { if (int_cursor != NULL) { while (int_cursor != NULL) { dlAddr = (const struct sockaddr_in *) int_cursor->ifa_addr; - if (dlAddr->sin_family == AF_INET) { + if (dlAddr != NULL && dlAddr->sin_family == AF_INET) { memcpy(ip, dlAddr, sizeof(struct sockaddr_in)); strncpy(name, int_cursor->ifa_name, nameLen - 1); name[nameLen - 1] = '\0'; -- cgit v1.2.3