1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 08:59:01 +00:00

Make sure Unix socket path is null-terminated, per unix(7)

This commit is contained in:
dmiller
2022-10-14 00:58:22 +00:00
parent ca691d2789
commit 6a9acb1f1a
5 changed files with 99 additions and 38 deletions

View File

@@ -1008,8 +1008,7 @@ int ncat_connect(void)
bye("Failed to create name for temporary DGRAM source Unix domain socket (tempnam).");
#endif
srcaddr.un.sun_family = AF_UNIX;
strncpy(srcaddr.un.sun_path, tmp_name, sizeof(srcaddr.un.sun_path));
NCAT_INIT_SUN(&srcaddr, tmp_name);
free (tmp_name);
}