projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7858cf
)
-make sure result is 0-terminated for UDS
author
Christian Grothoff
<christian@grothoff.org>
Wed, 24 Apr 2013 13:11:09 +0000
(13:11 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Wed, 24 Apr 2013 13:11:09 +0000
(13:11 +0000)
src/util/common_logging.c
patch
|
blob
|
history
diff --git
a/src/util/common_logging.c
b/src/util/common_logging.c
index cd845cccea3c54711bf2d1df1e6a5144f2ead009..5b355b2e1d570ee3c8a23382c0762075657e7b41 100644
(file)
--- 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;