fix: c.lang.security.insecure-use-string-copy-fn.insecure-use-string-copy-fn security vulnerability

Automated security fix generated by OrbisAI Security

Signed-off-by: orbisai0security <mediratta01.pally@gmail.com>
pull/72/head
orbisai0security 2026-06-21 16:27:23 +00:00
parent 10124fac19
commit 548b1435d9
1 changed files with 2 additions and 2 deletions

View File

@ -52,8 +52,8 @@ static int _setup_sockaddr(struct sockaddr_un *remote, const char *sock_path)
/* Setup the sockaddr structure */
memset(remote, 0, sizeof(*remote));
remote->sun_family = AF_UNIX;
/* We've already verified that sock_path will fit, so we don't need strncpy */
strcpy(remote->sun_path, sock_path);
/* We've already verified that sock_path will fit, copy including null terminator */
memcpy(remote->sun_path, sock_path, len + 1);
len += sizeof(*remote) - sizeof(remote->sun_path);
return len;