2000-04-07 Jeffrey Altman <jaltman@columbia.edu>
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 7 Apr 2000 18:44:34 +0000 (18:44 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 7 Apr 2000 18:44:34 +0000 (18:44 +0000)
* 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
src/lib/krb5/ccache/ccapi/stdcc_util.c

index b5d1a7d72a93f317fa7e5d5d1e265a3f00421928..a47bfd378ef45fa2aa52eb2c14115311a8334135 100644 (file)
@@ -1,3 +1,11 @@
+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): 
index dba42540d92048a9af025979ba6c75468fb196db..3f203d030d426591b7445dadf44929c5f25f33bc 100644 (file)
@@ -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;