summaryrefslogtreecommitdiffstats
path: root/utils/gssd/context_lucid.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2009-03-23 08:11:41 -0400
committerSteve Dickson <steved@redhat.com>2009-03-23 08:11:41 -0400
commit690b2eb64e44dc96db68900dd17ea4586b51966e (patch)
treef730ed92fda3b8828db124b7f1dc30ccb5494906 /utils/gssd/context_lucid.c
parent1a4bbe59d5cf0684c46b329fcc765eac97dab6ba (diff)
downloadnfs-utils-690b2eb64e44dc96db68900dd17ea4586b51966e.tar.gz
nfs-utils-690b2eb64e44dc96db68900dd17ea4586b51966e.tar.xz
nfs-utils-690b2eb64e44dc96db68900dd17ea4586b51966e.zip
gssd: initialize fakeseed in prepare_krb5_rfc1964_buffer
This causes a compiler warning and also means that we're stuffing the buffer with uninitialized junk from the stack. Other places in this code initialize "fakeseed" to 0. Do the same here. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/gssd/context_lucid.c')
-rw-r--r--utils/gssd/context_lucid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/gssd/context_lucid.c b/utils/gssd/context_lucid.c
index af7de58..4a682ae 100644
--- a/utils/gssd/context_lucid.c
+++ b/utils/gssd/context_lucid.c
@@ -70,9 +70,10 @@ static int
prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
gss_buffer_desc *buf, int32_t *endtime)
{
+#define FAKESEED_SIZE 16
char *p, *end;
static int constant_zero = 0;
- unsigned char fakeseed[16];
+ unsigned char fakeseed[FAKESEED_SIZE];
uint32_t word_send_seq;
gss_krb5_lucid_key_t enc_key;
int i;
@@ -88,6 +89,7 @@ prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
*/
memset(&enc_key, 0, sizeof(enc_key));
memset(&fakeoid, 0, sizeof(fakeoid));
+ memset(fakeseed, 0, FAKESEED_SIZE);
if (!(buf->value = calloc(1, MAX_CTX_LEN)))
goto out_err;
@@ -98,7 +100,7 @@ prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
/* seed_init and seed not used by kernel anyway */
if (WRITE_BYTES(&p, end, constant_zero)) goto out_err;
- if (write_bytes(&p, end, &fakeseed, 16)) goto out_err;
+ if (write_bytes(&p, end, &fakeseed, FAKESEED_SIZE)) goto out_err;
if (WRITE_BYTES(&p, end, lctx->rfc1964_kd.sign_alg)) goto out_err;
if (WRITE_BYTES(&p, end, lctx->rfc1964_kd.seal_alg)) goto out_err;