* ktutil_funcs.c (ktutil_add): Fix malloc size botches reported by
authorTom Yu <tlyu@mit.edu>
Wed, 12 Oct 2005 20:48:36 +0000 (20:48 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 12 Oct 2005 20:48:36 +0000 (20:48 +0000)
Will Fiveash.

ticket: 3002
target_version: 1.4.3
tags: pullup
component: krb5-admin
version_reported: 1.4

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17421 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/ktutil/ChangeLog
src/kadmin/ktutil/ktutil_funcs.c

index 0202686b794921027784812bc14fec0aff9aac4d..fb35124a51cabed355265a0e7de2d673aa94e8be 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-12  Tom Yu  <tlyu@mit.edu>
+
+       * ktutil_funcs.c (ktutil_add): Fix malloc size botches reported by
+       Will Fiveash.
+
 2003-05-19  Sam Hartman  <hartmans@mit.edu>
 
        * ktutil.c (main): Don't register writable keytab ops as they are
index c64a41caea55aedc23384354f153f7538d93e62b..649002e21fbcd37aaa1c7679395a735db992a13e 100644 (file)
@@ -138,12 +138,12 @@ krb5_error_code ktutil_add(context, list, princ_str, kvno,
     memset((char *) entry, 0, sizeof(*entry));
 
     if (!lp) {         /* if list is empty, start one */
-        lp = (krb5_kt_list) malloc(sizeof(krb5_kt_list));
+        lp = (krb5_kt_list) malloc(sizeof(*lp));
        if (!lp) {
            return ENOMEM;
        }
     } else {
-        lp->next = (krb5_kt_list) malloc(sizeof(krb5_kt_list));
+        lp->next = (krb5_kt_list) malloc(sizeof(*lp));
        if (!lp->next) {
            return ENOMEM;
        }