From 5ede3aa75e0bffe8d117b7482035998a1986b7f1 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 7 Apr 2000 18:44:34 +0000 Subject: [PATCH] 2000-04-07 Jeffrey Altman * 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)) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12153 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/ccapi/ChangeLog | 8 ++++++++ src/lib/krb5/ccache/ccapi/stdcc_util.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/ccache/ccapi/ChangeLog b/src/lib/krb5/ccache/ccapi/ChangeLog index b5d1a7d72..a47bfd378 100644 --- a/src/lib/krb5/ccache/ccapi/ChangeLog +++ b/src/lib/krb5/ccache/ccapi/ChangeLog @@ -1,3 +1,11 @@ +2000-04-07 Jeffrey Altman + + * 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 * stdcc_util.c (copyCCDataArrayToK5, copyCCDataArrayToK5): diff --git a/src/lib/krb5/ccache/ccapi/stdcc_util.c b/src/lib/krb5/ccache/ccapi/stdcc_util.c index dba42540d..3f203d030 100644 --- a/src/lib/krb5/ccache/ccapi/stdcc_util.c +++ b/src/lib/krb5/ccache/ccapi/stdcc_util.c @@ -37,7 +37,7 @@ int copyCCDataArrayToK5(cc_creds *ccCreds, krb5_creds *v5Creds, char whichArray) /* 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; @@ -75,7 +75,7 @@ int copyCCDataArrayToK5(cc_creds *ccCreds, krb5_creds *v5Creds, char whichArray) /* 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; @@ -123,7 +123,7 @@ int copyK5DataArrayToCC(krb5_creds *v5Creds, cc_creds *ccCreds, char whichArray) /* 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; @@ -160,7 +160,7 @@ int copyK5DataArrayToCC(krb5_creds *v5Creds, cc_creds *ccCreds, char whichArray) /* 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; -- 2.26.2