diff options
Diffstat (limited to 'test/test_syscalls.c')
-rw-r--r-- | test/test_syscalls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_syscalls.c b/test/test_syscalls.c index 1d776fd..e1dbab3 100644 --- a/test/test_syscalls.c +++ b/test/test_syscalls.c @@ -1757,7 +1757,8 @@ static int test_socket(void) return -1; } su.sun_family = AF_UNIX; - strncpy(su.sun_path, testsock, sizeof(su.sun_path)); + strncpy(su.sun_path, testsock, sizeof(su.sun_path) - 1); + su.sun_path[sizeof(su.sun_path) - 1] = '\0'; res = bind(fd, (struct sockaddr*)&su, sizeof(su)); if (res == -1) { PERROR("bind"); |