summaryrefslogtreecommitdiff
blob: cbc2c39f7750dbce357a08dd27931b0e98051919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/ipset.c b/ipset.c
index ba007e5..de6a4ec 100644
--- a/ipset.c
+++ b/ipset.c
@@ -626,7 +626,8 @@ void parse_ip(const char *str, ip_set_ip_t * ip)
 				   "host/network `%s' resolves to serveral ip-addresses. "
 				   "Please specify one.", str);
 
-		*ip = ntohl(((struct in_addr *) host->h_addr_list[0])->s_addr);
+		memcpy(&addr, host->h_addr_list[0], sizeof(struct in_addr));
+		*ip = ntohl(addr.s_addr);
 		return;
 	}