Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit baa72abe authored by Deucе's avatar Deucе 👌🏾

Make inet_ptoaddr() not crash and work with IPv4 address strings

parent baa471f6
Pipeline #2272 passed with stage
in 10 minutes and 41 seconds
......@@ -617,9 +617,11 @@ union xp_sockaddr* inet_ptoaddr(char *addr_str, union xp_sockaddr *addr, size_t
if(getaddrinfo(addr_str, NULL, &hints, &res))
return NULL;
for(cur = res; cur; cur++) {
for(cur = res; cur; cur = cur->ai_next) {
if(cur->ai_addr->sa_family == AF_INET6)
break;
if(cur->ai_addr->sa_family == AF_INET)
break;
}
if(!cur) {
freeaddrinfo(res);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment