From: Patrick McHardy Date: Tue, 3 Aug 2004 22:38:39 +0000 (+0000) Subject: Allocate enough memory for addr-list in host_to_addr() X-Git-Tag: v1.3.0-rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80938445c0b6597d80ddc29c0cee06e40d4bdc4f;p=thirdparty%2Fiptables.git Allocate enough memory for addr-list in host_to_addr() --- 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]);