diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-07-26 17:13:50 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-07-27 18:15:44 +0000 |
commit | 1cea7b5a97a0069eb409bf86e4a67913b687c3bd (patch) | |
tree | 04757823ff683b016d3e6de60d95269d4d37c448 | |
parent | ebe4ef738351780bc0b011fc514e257f26bfff6a (diff) |
fix strncpy bugs in socket.c
Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486
-rw-r--r-- | src/socket.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c index 04058474..dc5590c0 100644 --- a/src/socket.c +++ b/src/socket.c @@ -596,8 +596,7 @@ int osmo_sock_unix_init(uint16_t type, uint8_t proto, return -EINVAL; local.sun_family = AF_UNIX; - strncpy(local.sun_path, socket_path, sizeof(local.sun_path)); - local.sun_path[sizeof(local.sun_path) - 1] = '\0'; + osmo_strlcpy(local.sun_path, socket_path, sizeof(local.sun_path)); #if defined(BSD44SOCKETS) || defined(__UNIXWARE__) local.sun_len = strlen(local.sun_path); |