diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2013-05-23 14:36:46 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2013-05-23 19:45:03 -0400 |
commit | 32e74ad267962ce913ea8fb1fb26500dc277dcc9 (patch) | |
tree | ee48d787e393a8cb4398ecd33733a71fb4bf1b48 | |
parent | 9f112bfb1354de7c9a58915c9b0641341b2c4f2c (diff) | |
download | slapi-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.c | 4 | ||||
-rw-r--r-- | src/portmap.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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, |