From 250448df7df4dcffc53c0c3bcf623365904ddc27 Mon Sep 17 00:00:00 2001 From: emaste Date: Mon, 19 Nov 2012 22:56:51 +0000 Subject: Zero the whole struct not just the size of a pointer. Found by: clang --- tools/regression/sockets/unix_cmsg/unix_cmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/regression/sockets/unix_cmsg/unix_cmsg.c') diff --git a/tools/regression/sockets/unix_cmsg/unix_cmsg.c b/tools/regression/sockets/unix_cmsg/unix_cmsg.c index c16b468..06728d7 100644 --- a/tools/regression/sockets/unix_cmsg/unix_cmsg.c +++ b/tools/regression/sockets/unix_cmsg/unix_cmsg.c @@ -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", -- cgit v1.1