---
 fish/rc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fish/rc.c b/fish/rc.c
index 8e22c53..c066d98 100644
--- a/fish/rc.c
+++ b/fish/rc.c
@@ -82,7 +82,8 @@ create_sockpath (pid_t pid, char *sockpath, size_t len,
   snprintf (sockpath, len, SOCKET_PATH, euid, pid);
 
   addr->sun_family = AF_UNIX;
-  strcpy (addr->sun_path, sockpath);
+  strncpy (addr->sun_path, sockpath, UNIX_PATH_MAX);
+  addr->sun_path[UNIX_PATH_MAX-1] = '\0';
 }
 
 static const socklen_t controllen = CMSG_LEN (sizeof (int));
-- 
1.9.3

_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to