diff options
Diffstat (limited to 'src/util/test_server_with_client_unix.c')
-rw-r--r-- | src/util/test_server_with_client_unix.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/util/test_server_with_client_unix.c b/src/util/test_server_with_client_unix.c index 30e993411..49b70478d 100644 --- a/src/util/test_server_with_client_unix.c +++ b/src/util/test_server_with_client_unix.c | |||
@@ -130,20 +130,15 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
130 | { | 130 | { |
131 | struct sockaddr_un un; | 131 | struct sockaddr_un un; |
132 | const char *unixpath = "/tmp/testsock"; | 132 | const char *unixpath = "/tmp/testsock"; |
133 | size_t slen = strlen (unixpath); | ||
134 | struct sockaddr *sap[2]; | 133 | struct sockaddr *sap[2]; |
135 | socklen_t slens[2]; | 134 | socklen_t slens[2]; |
136 | 135 | ||
137 | memset (&un, 0, sizeof (un)); | 136 | memset (&un, 0, sizeof (un)); |
138 | un.sun_family = AF_UNIX; | 137 | un.sun_family = AF_UNIX; |
139 | memcpy (un.sun_path, unixpath, slen); | 138 | strncpy(un.sun_path, unixpath, sizeof (un.sun_path) - 1); |
140 | un.sun_path[slen] = '\0'; | ||
141 | #if HAVE_SOCKADDR_IN_SIN_LEN | 139 | #if HAVE_SOCKADDR_IN_SIN_LEN |
142 | un.sun_len = (u_char) sizeof (un); | 140 | un.sun_len = (u_char) sizeof (un); |
143 | #endif | 141 | #endif |
144 | #if LINUX | ||
145 | un.sun_path[0] = '\0'; | ||
146 | #endif | ||
147 | 142 | ||
148 | sap[0] = (struct sockaddr *) &un; | 143 | sap[0] = (struct sockaddr *) &un; |
149 | slens[0] = sizeof (un); | 144 | slens[0] = sizeof (un); |