Zero the whole struct not just the size of a pointer.

Found by: clang
This commit is contained in:
Ed Maste 2012-11-19 22:56:51 +00:00
parent d701ebcb13
commit 8f37d24bed

View file

@ -449,7 +449,7 @@ create_socket(char *sock_path, size_t sock_path_len, struct sockaddr_un *addr)
goto failed;
}
memset(addr, 0, sizeof(addr));
memset(addr, 0, sizeof(*addr));
addr->sun_family = AF_LOCAL;
if (strlen(sock_path) >= sizeof(addr->sun_path)) {
logmsgx("create_socket: too long path name (>= %lu) for local domain socket",