From c40b05b4c4226b2c4323a9ba5b096377931682ef Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 9 Dec 2008 00:16:11 +0000 Subject: getaddrinfo: runp->ifa_addr indeed can be NULL, don't dereference it ifaddrs.c: cosmetics, no code changes --- libc/inet/ifaddrs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libc/inet/ifaddrs.c') diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c index 3afc6b923..1d54d5123 100644 --- a/libc/inet/ifaddrs.c +++ b/libc/inet/ifaddrs.c @@ -452,10 +452,7 @@ getifaddrs (struct ifaddrs **ifap) /* Allocate memory for all entries we have and initialize next pointer. */ - ifas = (struct ifaddrs_storage *) calloc (1, - (newlink + newaddr) - * sizeof (struct ifaddrs_storage) - + ifa_data_size); + ifas = calloc (1, (newlink + newaddr) * sizeof (ifas[0]) + ifa_data_size); if (ifas == NULL) { result = -1; -- cgit v1.2.3