summaryrefslogtreecommitdiff
path: root/libc/inet/ifaddrs.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-09 00:16:11 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-09 00:16:11 +0000
commitc40b05b4c4226b2c4323a9ba5b096377931682ef (patch)
treea94cfc05d1f4d350cd17a8773e566d11fc275e73 /libc/inet/ifaddrs.c
parent73723d710b6f1868a20f8eb36383795524f516ad (diff)
getaddrinfo: runp->ifa_addr indeed can be NULL, don't dereference it
ifaddrs.c: cosmetics, no code changes
Diffstat (limited to 'libc/inet/ifaddrs.c')
-rw-r--r--libc/inet/ifaddrs.c5
1 files changed, 1 insertions, 4 deletions
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;