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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user