diff mbox series

Fix coverity #292147

Message ID 20200416201622.32387-2-sbabic@denx.de
State Accepted
Headers show
Series Fix coverity #292147 | expand

Commit Message

Stefano Babic April 16, 2020, 8:16 p.m. UTC
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 ipc/network_ipc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ipc/network_ipc.c b/ipc/network_ipc.c
index 1f3d6a2..149c1be 100644
--- a/ipc/network_ipc.c
+++ b/ipc/network_ipc.c
@@ -52,7 +52,7 @@  static int prepare_ipc(void) {
 	bzero(&servaddr, sizeof(servaddr));
 	servaddr.sun_family = AF_LOCAL;
 
-	strncpy(servaddr.sun_path, get_ctrl_socket(), sizeof(servaddr.sun_path));
+	strncpy(servaddr.sun_path, get_ctrl_socket(), sizeof(servaddr.sun_path) - 1);
 
 	ret = connect(connfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
 	if (ret < 0) {