aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-12-03 18:14:58 +1100
committerH. Peter Anvin <hpa@zytor.com>2013-12-03 10:53:38 -0800
commit71a849a7e2d5e73321e986fa91d1f34b387e71ba (patch)
tree51176cc5fc1f371d2514baf3c7968ce3aa8c6691
parentcb90a942dcb20ca34ea6d7b2f3df80d28378d871 (diff)
downloadklibc-71a849a7e2d5e73321e986fa91d1f34b387e71ba.tar.gz
[klibc] nfsmount: memset uses sizeof pointer as length
gcc picked up a couple of suspicious memset lengths which turned out to be real bugs. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--usr/kinit/nfsmount/sunrpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/kinit/nfsmount/sunrpc.c b/usr/kinit/nfsmount/sunrpc.c
index 0628cef782522..0a7fcf5a2e8d2 100644
--- a/usr/kinit/nfsmount/sunrpc.c
+++ b/usr/kinit/nfsmount/sunrpc.c
@@ -149,7 +149,7 @@ struct client *tcp_client(uint32_t server, uint16_t port, uint32_t flags)
goto bail;
}
- memset(clnt, 0, sizeof(clnt));
+ memset(clnt, 0, sizeof(*clnt));
if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
perror("socket");
@@ -194,7 +194,7 @@ struct client *udp_client(uint32_t server, uint16_t port, uint32_t flags)
goto bail;
}
- memset(clnt, 0, sizeof(clnt));
+ memset(clnt, 0, sizeof(*clnt));
if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
perror("socket");