/* now create the actual ticket */
ticketLen = sizeof(tbuffer);
+ memset(tbuffer, '\0', sizeof(tbuffer));
code = tkt_MakeTicket(tbuffer, &ticketLen, &key, AUTH_SUPERUSER, "", "", 0,
0xffffffff, &session, 0, "afs", "");
/* parms were buffer, ticketlen, key to seal ticket with, principal
{
/* better pass 8 bytes, length not checked here */
- register afs_uint32 R1, L1; /* R1 = r10, L1 = r9 */
- register afs_uint32 R2, L2; /* R2 = r8, L2 = r7 */
+ register afs_uint32 R1 = 0, L1 = 0; /* R1 = r10, L1 = r9 */
+ register afs_uint32 R2 = 0, L2 = 0; /* R2 = r8, L2 = r7 */
afs_int32 i;
/* one more registers left on VAX, see below P_temp_p */
#ifdef BITS16
tfirst = CBtime(FT_ApproxTime());
/* N.B. The "-1", below, is because
FE[0] and CB[0] are not used--and not allocated */
- FE = ((struct FileEntry *)(malloc(sizeof(struct FileEntry)*nblks)))-1;
+ FE = ((struct FileEntry *)(calloc(nblks, sizeof(struct FileEntry))))-1;
if (!FE) {
ViceLog(0, ("Failed malloc in InitCallBack\n"));
assert(0);
cbstuff.nFEs = nblks;
while (cbstuff.nFEs)
FreeFE(&FE[cbstuff.nFEs]); /* This is correct */
- CB = ((struct CallBack *)(malloc(sizeof(struct CallBack)*nblks)))-1;
+ CB = ((struct CallBack *)(calloc(nblks, sizeof(struct CallBack))))-1;
if (!CB) {
ViceLog(0, ("Failed malloc in InitCallBack\n"));
assert(0);
read(fd, timeout, sizeof(timeout));
read(fd, &tfirst, sizeof(tfirst));
read(fd, &freelisthead, sizeof(freelisthead));
- CB = ((struct CallBack *)(malloc(sizeof(struct FileEntry)*cbstuff.nblks)))-1;
- FE = ((struct FileEntry *)(malloc(sizeof(struct FileEntry)*cbstuff.nblks)))-1;
+ CB = ((struct CallBack *)(calloc(cbstuff.nblks,sizeof(struct FileEntry))))-1;
+ FE = ((struct FileEntry *)(calloc(cbstuff.nblks,sizeof(struct FileEntry))))-1;
CBfree = (struct CallBack *) itocb(freelisthead);
read(fd, &freelisthead, sizeof(freelisthead));
FEfree = (struct FileEntry *) itofe(freelisthead);
sc = rxnull_NewClientSecurityObject();
i = host->interface->numberOfInterfaces;
- addr = malloc(i * sizeof(afs_int32));
- conns = malloc(i * sizeof(struct rx_connection *));
+ addr = calloc(i, sizeof(afs_int32));
+ conns = calloc(i, sizeof(struct rx_connection *));
if (!addr || !conns) {
ViceLog(0, ("Failed malloc in MultiBreakCallBackAlternateAddress_r\n"));
assert(0);
sc = rxnull_NewClientSecurityObject();
i = host->interface->numberOfInterfaces;
- addr = malloc(i * sizeof(afs_int32));
- conns = malloc(i * sizeof(struct rx_connection *));
+ addr = calloc(i, sizeof(afs_int32));
+ conns = calloc(i, sizeof(struct rx_connection *));
if (!addr || !conns) {
ViceLog(0, ("Failed malloc in MultiProbeAlternateAddress_r\n"));
assert(0);