Commit 83e80388 authored by deuce's avatar deuce
Browse files

Fix multiple memory-corruption buts in inet_ptoaddr()

(only impacts active FTP transfers via IPv6).
parent 2d6920b0
......@@ -425,7 +425,12 @@ union xp_sockaddr* DLLCALL inet_ptoaddr(char *addr_str, union xp_sockaddr *addr,
freeaddrinfo(res);
return NULL;
}
memcpy(&addr, &((struct sockaddr_in6 *)(cur->ai_addr))->sin6_addr, size);
if (size < sizeof(struct sockaddr_in6)) {
freeaddrinfo(res);
return NULL;
}
size = sizeof(struct sockaddr_in6);
memcpy(addr, ((struct sockaddr_in6 *)(cur->ai_addr)), size);
freeaddrinfo(res);
return addr;
}
......
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