summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2013-05-23 14:36:46 -0400
committerNalin Dahyabhai <nalin@redhat.com>2013-05-23 19:45:03 -0400
commit32e74ad267962ce913ea8fb1fb26500dc277dcc9 (patch)
treeee48d787e393a8cb4398ecd33733a71fb4bf1b48
parent9f112bfb1354de7c9a58915c9b0641341b2c4f2c (diff)
downloadslapi-nis-32e74ad267962ce913ea8fb1fb26500dc277dcc9.tar.gz
slapi-nis-32e74ad267962ce913ea8fb1fb26500dc277dcc9.tar.xz
slapi-nis-32e74ad267962ce913ea8fb1fb26500dc277dcc9.zip
Fix some uninitialized-jump warnings
Clear buffers that we encode data into before encoding them, to avoid valgrind warnings that their contents are used before they're written to.
-rw-r--r--src/nis.c4
-rw-r--r--src/portmap.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/nis.c b/src/nis.c
index 6144806..2521ac5 100644
--- a/src/nis.c
+++ b/src/nis.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008,2011 Red Hat, Inc.
+ * Copyright 2008,2011,2013 Red Hat, Inc.
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -906,6 +906,8 @@ nis_process_request(struct plugin_state *state,
memset(&reply_xdrs, 0, sizeof(reply_xdrs));
memset(&request, 0, sizeof(request));
memset(&reply, 0, sizeof(reply));
+ memset(&auth_buf, 0, sizeof(auth_buf));
+ memset(reply_buf, 0, reply_buf_size);
/* Parse the client request and make sure it looks like an RPC. */
xdrmem_create(&request_xdrs, request_buf, request_buflen, XDR_DECODE);
diff --git a/src/portmap.c b/src/portmap.c
index 6b4a3cd..6a3d29f 100644
--- a/src/portmap.c
+++ b/src/portmap.c
@@ -156,6 +156,7 @@ portmap_register_work(const char *module, int client_sock,
msg.rm_call.cb_proc = proc;
/* Build an authenticator. */
+ memset(&auth_buf, 0, sizeof(auth_buf));
xdrmem_create(&auth_xdrs, auth_buf, sizeof(auth_buf), XDR_ENCODE);
auth = authnone_create();
auth_marshall(auth, &auth_xdrs);
@@ -163,6 +164,7 @@ portmap_register_work(const char *module, int client_sock,
msg.rm_call.cb_verf = auth->ah_verf;
/* Encode the header and the arguments, then clean up temporaries. */
+ memset(&portmap_buf, 0, sizeof(portmap_buf));
if (stream) {
/* Leave room for the message length on a stream connection. */
xdrmem_create(&portmap_xdrs,