Fix lengths of interface names

Use helper function similar to copy correctly limited names into
buffers.
This commit is contained in:
Petr Menšík
2018-08-15 18:17:00 +02:00
committed by Simon Kelley
parent 2b38e3823b
commit 47b45b2967
11 changed files with 44 additions and 26 deletions

View File

@@ -232,7 +232,7 @@ static void log_write(void)
logaddr.sun_len = sizeof(logaddr) - sizeof(logaddr.sun_path) + strlen(_PATH_LOG) + 1;
#endif
logaddr.sun_family = AF_UNIX;
strncpy(logaddr.sun_path, _PATH_LOG, sizeof(logaddr.sun_path));
safe_strncpy(logaddr.sun_path, _PATH_LOG, sizeof(logaddr.sun_path));
/* Got connection back? try again. */
if (connect(log_fd, (struct sockaddr *)&logaddr, sizeof(logaddr)) != -1)