diff --git a/src/afs/afs_pag_call.c b/src/afs/afs_pag_call.c index 9b7a90631e..0515172e77 100644 --- a/src/afs/afs_pag_call.c +++ b/src/afs/afs_pag_call.c @@ -466,6 +466,8 @@ afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, int follow) goto out_idata; } + memset(odata.rmtbulk_val, 0, out_size); + AFS_GUNLOCK(); code = RMTSYS_Pioctl(rmtsys_conn, &ccred, abspath, com, follow, &idata, &odata, &err); diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 10f088a478..dc7847fd14 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -2725,6 +2725,8 @@ DBLookupByVolume(char *volumeName) char vname[BU_MAXNAMELEN]; char ds[50]; + memset(volumeEntry, 0, sizeof(volumeEntry)); + for (pass = 0; pass < 2; pass++) { /*p */ /* On second pass, search for backup volume */ diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index b73a9351f3..b7fb1d4b3f 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -191,7 +191,7 @@ bc_Restorer(afs_int32 aindex) serverAll = HOSTADDR(&dumpTaskPtr->destServer); partitionAll = dumpTaskPtr->destPartition; - volumeEntries = malloc(MAXTAPESATONCE * sizeof(struct budb_volumeEntry)); + volumeEntries = calloc(MAXTAPESATONCE, sizeof(struct budb_volumeEntry)); if (!volumeEntries) { afs_com_err(whoami, BC_NOMEM, NULL); ERROR(BC_NOMEM); diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index 8bf34fcaba..381095f03a 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -524,12 +524,15 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con oanswer.MaxSeqLen = sizeof(answer); oanswer.SeqLen = 0; oanswer.SeqBody = (char *)&answer; + memset(&answer, 0, sizeof(answer)); + memset(&answer_old, 0, sizeof(answer_old)); version = 2; code = kawrap_ubik_Call(KAA_AuthenticateV2, conn, 0, name, instance, (void*)(uintptr_t)start, (void*)(uintptr_t)end, &arequest, &oanswer, 0, 0); if (code == RXGEN_OPCODE) { + oanswer.SeqLen = 0; oanswer.MaxSeqLen = sizeof(answer); oanswer.SeqBody = (char *)&answer; version = 1; @@ -537,6 +540,7 @@ ka_Authenticate(char *name, char *instance, char *cell, struct ubik_client * con ubik_KAA_Authenticate(conn, 0, name, instance, start, end, &arequest, &oanswer); if (code == RXGEN_OPCODE) { + oanswer.SeqLen = 0; oanswer.MaxSeqLen = sizeof(answer_old); oanswer.SeqBody = (char *)&answer_old; version = 0; diff --git a/src/sys/rmtsysc.c b/src/sys/rmtsysc.c index 0a41489b89..6881234220 100644 --- a/src/sys/rmtsysc.c +++ b/src/sys/rmtsysc.c @@ -214,7 +214,7 @@ pioctl(char *path, afs_int32 cmd, struct ViceIoctl *data, afs_int32 follow) inparam_conversion(cmd, InData.rmtbulk_val, 0); OutData.rmtbulk_len = MAXBUFFERLEN * sizeof(*OutData.rmtbulk_val); - OutData.rmtbulk_val = malloc(OutData.rmtbulk_len); + OutData.rmtbulk_val = calloc(1, OutData.rmtbulk_len); if (!OutData.rmtbulk_val) { free(inbuffer); return -1;