Merge pull request #49 from jktjkt/fix-ipv6
Use proper size for inet_ntop's buffer
diff --git a/src/session_server.c b/src/session_server.c
index 67b1198..73126f3 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));