From de3edfe8540884dc55e90d3ab18eae3449cba04f Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Mon, 10 Feb 2014 10:15:37 +0000 Subject: - Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of UNIX sockets. --- src/util/common_logging.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 19ae50257..5faa4af73 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -1139,7 +1139,14 @@ GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid) const char * GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) { - static char buf[INET6_ADDRSTRLEN + 8]; +#ifndef WINDOWS +#define LEN GNUNET_MAX ((INET6_ADDRSTRLEN + 8), \ + (sizeof (struct sockaddr_un) - sizeof (sa_family_t))) +#else +#define LEN (INET6_ADDRSTRLEN + 8) +#endif + static char buf[LEN]; +#undef LEN static char b2[6]; const struct sockaddr_in *v4; const struct sockaddr_un *un; -- cgit v1.2.3