diff options
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/common/responder_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 54d6c49e1..231d82806 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -467,7 +467,8 @@ static int set_unix_socket(struct resp_ctx *rctx) memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, rctx->sock_name, sizeof(addr.sun_path)); + strncpy(addr.sun_path, rctx->sock_name, sizeof(addr.sun_path)-1); + addr.sun_path[sizeof(addr.sun_path)-1] = '\0'; /* make sure we have no old sockets around */ unlink(rctx->sock_name); @@ -504,7 +505,8 @@ static int set_unix_socket(struct resp_ctx *rctx) memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, rctx->priv_sock_name, sizeof(addr.sun_path)); + strncpy(addr.sun_path, rctx->priv_sock_name, sizeof(addr.sun_path)-1); + addr.sun_path[sizeof(addr.sun_path)-1] = '\0'; unlink(rctx->priv_sock_name); |