X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Fcommon_logging.c;h=5b355b2e1d570ee3c8a23382c0762075657e7b41;hb=72c8645af31896829b674b575c5375706f362a30;hp=cd845cccea3c54711bf2d1df1e6a5144f2ead009;hpb=429d914cdd3dd4eb662c0ca85fa3de77b26e15cc;p=oweals%2Fgnunet.git diff --git a/src/util/common_logging.c b/src/util/common_logging.c index cd845ccce..5b355b2e1 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -1206,7 +1206,8 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) off = 0; if (un->sun_path[0] == '\0') off++; - snprintf (buf, sizeof (buf), "%s%.*s", (off == 1) ? "@" : "", + memset (buf, 0, sizeof (buf)); + snprintf (buf, sizeof (buf) - 1, "%s%.*s", (off == 1) ? "@" : "", (int) (addrlen - sizeof (sa_family_t) - 1 - off), &un->sun_path[off]); return buf;