Use proper size for inet_ntop's buffer
The manpage suggests to use this macro. The old code was failing for
IPv6-mapped IPv4 addresses.
diff --git a/src/session_server.c b/src/session_server.c
index 5d376d7..1515fe5 100644
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -352,7 +352,7 @@
ERRMEM;
}
} else if (saddr.ss_family == AF_INET6) {
- *host = malloc(40);
+ *host = malloc(INET6_ADDRSTRLEN);
if (*host) {
if (!inet_ntop(AF_INET6, ((struct sockaddr_in6 *)&saddr)->sin6_addr.s6_addr, *host, 40)) {
ERR("inet_ntop failed (%s).", strerror(errno));