+2000-04-07 Jeffrey Altman <jaltman@columbia.edu>
+
+ * stdcc_util.c (copyCCDataArrayToK5, copyCCDataArrayToK5):
+ * stdcc_util.c (dupCCtoK5, dupK5toCC):
+
+ memory was being allocated as (sizeof(foo) * count + 1)
+ instead of (sizeof(foo) * (count + 1))
+
2000-04-03 Jeffrey Altman <jaltman@columbia.edu>
* stdcc_util.c (copyCCDataArrayToK5, copyCCDataArrayToK5):
/* Allocate the array of pointers: */
for (dataPtr = ccCreds->addresses; *dataPtr != NULL; numRecords++, dataPtr++) {}
- v5Creds->addresses = (krb5_address **) malloc (sizeof(krb5_address *) * numRecords + 1);
+ v5Creds->addresses = (krb5_address **) malloc (sizeof(krb5_address *) * (numRecords + 1));
if (v5Creds->addresses == NULL)
return ENOMEM;
/* Allocate the array of pointers: */
for (dataPtr = ccCreds->authdata; *dataPtr != NULL; numRecords++, dataPtr++) {}
- v5Creds->authdata = (krb5_authdata **) malloc (sizeof(krb5_authdata *) * numRecords + 1);
+ v5Creds->authdata = (krb5_authdata **) malloc (sizeof(krb5_authdata *) * (numRecords + 1));
if (v5Creds->authdata == NULL)
return ENOMEM;
/* Allocate the array of pointers: */
for (addrPtr = v5Creds->addresses; *addrPtr != NULL; numRecords++, addrPtr++) {}
- ccCreds->addresses = (cc_data **) malloc (sizeof(cc_data *) * numRecords + 1);
+ ccCreds->addresses = (cc_data **) malloc (sizeof(cc_data *) * (numRecords + 1));
if (ccCreds->addresses == NULL)
return ENOMEM;
/* Allocate the array of pointers: */
for (authPtr = v5Creds->authdata; *authPtr != NULL; numRecords++, authPtr++) {}
- ccCreds->authdata = (cc_data **) malloc (sizeof(cc_data *) * numRecords + 1);
+ ccCreds->authdata = (cc_data **) malloc (sizeof(cc_data *) * (numRecords + 1));
if (ccCreds->authdata == NULL)
return ENOMEM;