summaryrefslogtreecommitdiffstats
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-05-13 13:40:58 +0200
committerGitHub <noreply@github.com>2022-05-13 13:40:58 +0200
commitf205a2309c7dc961216417fb49b4639892b219be (patch)
tree9a9839c3e141e990c96c43a1788ce9c6d95ea84b /lib/vty.c
parentMerge pull request #11188 from opensourcerouting/fix/argv_find (diff)
parent*: Properly use memset() when zeroing (diff)
downloadfrr-f205a2309c7dc961216417fb49b4639892b219be.tar.xz
frr-f205a2309c7dc961216417fb49b4639892b219be.zip
Merge pull request #11177 from opensourcerouting/fix/memset_memcpy
*: memcpy/memset zeroing
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 619d51e1c..e0e2f3922 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1827,7 +1827,7 @@ static void vty_serv_sock_addrinfo(const char *hostname, unsigned short port)
int sock;
char port_str[BUFSIZ];
- memset(&req, 0, sizeof(struct addrinfo));
+ memset(&req, 0, sizeof(req));
req.ai_flags = AI_PASSIVE;
req.ai_family = AF_UNSPEC;
req.ai_socktype = SOCK_STREAM;
@@ -1912,7 +1912,7 @@ static void vty_serv_un(const char *path)
}
/* Make server socket. */
- memset(&serv, 0, sizeof(struct sockaddr_un));
+ memset(&serv, 0, sizeof(serv));
serv.sun_family = AF_UNIX;
strlcpy(serv.sun_path, path, sizeof(serv.sun_path));
#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
@@ -1976,7 +1976,7 @@ static void vtysh_accept(struct thread *thread)
vty_event_serv(VTYSH_SERV, vtyserv);
- memset(&client, 0, sizeof(struct sockaddr_un));
+ memset(&client, 0, sizeof(client));
client_len = sizeof(struct sockaddr_un);
sock = accept(accept_sock, (struct sockaddr *)&client,