mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-09 01:18:39 +03:00
strcpy -> strncpy in common daemon code.
This commit is contained in:
parent
fb4f76a29c
commit
48511e9bd6
@ -32,7 +32,7 @@ daemon_handle daemon_open(daemon_info i) {
|
||||
goto error;
|
||||
|
||||
memset(&sockaddr, 0, sizeof(sockaddr));
|
||||
strcpy(sockaddr.sun_path, i.socket);
|
||||
strncpy(sockaddr.sun_path, i.socket, sizeof(sockaddr.sun_path));
|
||||
sockaddr.sun_family = AF_UNIX;
|
||||
if (connect(h.socket_fd,(struct sockaddr *) &sockaddr, sizeof(sockaddr)))
|
||||
goto error;
|
||||
|
@ -224,7 +224,7 @@ static int _open_socket(daemon_state s)
|
||||
|
||||
fprintf(stderr, "[D] creating %s\n", s.socket_path);
|
||||
memset(&sockaddr, 0, sizeof(sockaddr));
|
||||
strcpy(sockaddr.sun_path, s.socket_path);
|
||||
strncpy(sockaddr.sun_path, s.socket_path, sizeof(sockaddr.sun_path));
|
||||
sockaddr.sun_family = AF_UNIX;
|
||||
|
||||
if (bind(fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
|
||||
|
Loading…
Reference in New Issue
Block a user