Since we are going to strlen() on the string, it is supposed to be
NUL-terminated, so use strlcpy() instead of strncpy() here.
This commit is contained in:
parent
9bbd8028fa
commit
ecce338eb4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184187
@ -173,7 +173,7 @@ init_runtime_env(struct configuration *config)
|
||||
|
||||
memset(&serv_addr, 0, sizeof(struct sockaddr_un));
|
||||
serv_addr.sun_family = PF_LOCAL;
|
||||
strncpy(serv_addr.sun_path, config->socket_path,
|
||||
strlcpy(serv_addr.sun_path, config->socket_path,
|
||||
sizeof(serv_addr.sun_path));
|
||||
serv_addr_len = sizeof(serv_addr.sun_family) +
|
||||
strlen(serv_addr.sun_path) + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user