diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2014-02-10 10:15:37 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2014-02-10 10:15:37 +0000 |
commit | de3edfe8540884dc55e90d3ab18eae3449cba04f (patch) | |
tree | 2d171b1c3dd1741421affefc54494f44a0fd0035 /src | |
parent | b9f836d700829533b83955bc2f871c5e2edf7e7f (diff) | |
download | gnunet-de3edfe8540884dc55e90d3ab18eae3449cba04f.tar.gz gnunet-de3edfe8540884dc55e90d3ab18eae3449cba04f.zip |
- Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of UNIX sockets.
Diffstat (limited to 'src')
-rw-r--r-- | src/util/common_logging.c | 9 |
1 files changed, 8 insertions, 1 deletions
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) | |||
1139 | const char * | 1139 | const char * |
1140 | GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) | 1140 | GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) |
1141 | { | 1141 | { |
1142 | static char buf[INET6_ADDRSTRLEN + 8]; | 1142 | #ifndef WINDOWS |
1143 | #define LEN GNUNET_MAX ((INET6_ADDRSTRLEN + 8), \ | ||
1144 | (sizeof (struct sockaddr_un) - sizeof (sa_family_t))) | ||
1145 | #else | ||
1146 | #define LEN (INET6_ADDRSTRLEN + 8) | ||
1147 | #endif | ||
1148 | static char buf[LEN]; | ||
1149 | #undef LEN | ||
1143 | static char b2[6]; | 1150 | static char b2[6]; |
1144 | const struct sockaddr_in *v4; | 1151 | const struct sockaddr_in *v4; |
1145 | const struct sockaddr_un *un; | 1152 | const struct sockaddr_un *un; |