summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2004-08-03 22:38:39 +0000
committerPatrick McHardy <kaber@trash.net>2004-08-03 22:38:39 +0000
commit80938445c0b6597d80ddc29c0cee06e40d4bdc4f (patch)
tree005e42d4df90fd36037cdc6d581bc7b325b58886 /iptables.c
parent46e8538e2254fcd48517067b659bcdc8ba1c3cc0 (diff)
Allocate enough memory for addr-list in host_to_addr()
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables.c b/iptables.c
index 6ab4c497..c69eb43d 100644
--- a/iptables.c
+++ b/iptables.c
@@ -551,7 +551,7 @@ host_to_addr(const char *name, unsigned int *naddr)
while (host->h_addr_list[*naddr] != (char *) NULL)
(*naddr)++;
- addr = fw_calloc(*naddr, sizeof(struct in_addr));
+ addr = fw_calloc(*naddr, sizeof(struct in_addr) * *naddr);
for (i = 0; i < *naddr; i++)
inaddrcpy(&(addr[i]),
(struct in_addr *) host->h_addr_list[i]);