gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r26987 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r26987 - gnunet/src/util
Date: Wed, 24 Apr 2013 15:11:09 +0200

Author: grothoff
Date: 2013-04-24 15:11:09 +0200 (Wed, 24 Apr 2013)
New Revision: 26987

Modified:
   gnunet/src/util/common_logging.c
Log:
-make sure result is 0-terminated for UDS

Modified: gnunet/src/util/common_logging.c
===================================================================
--- gnunet/src/util/common_logging.c    2013-04-24 12:42:49 UTC (rev 26986)
+++ gnunet/src/util/common_logging.c    2013-04-24 13:11:09 UTC (rev 26987)
@@ -1206,7 +1206,8 @@
     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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]