From: Tom Yu Date: Wed, 12 Oct 2005 20:48:36 +0000 (+0000) Subject: * ktutil_funcs.c (ktutil_add): Fix malloc size botches reported by X-Git-Tag: ms-bug-test-20060525~114 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b8fdb9cba51392a9d60258787b7f06000436ad67;p=krb5.git * ktutil_funcs.c (ktutil_add): Fix malloc size botches reported by 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 --- diff --git a/src/kadmin/ktutil/ChangeLog b/src/kadmin/ktutil/ChangeLog index 0202686b7..fb35124a5 100644 --- a/src/kadmin/ktutil/ChangeLog +++ b/src/kadmin/ktutil/ChangeLog @@ -1,3 +1,8 @@ +2005-10-12 Tom Yu + + * ktutil_funcs.c (ktutil_add): Fix malloc size botches reported by + Will Fiveash. + 2003-05-19 Sam Hartman * ktutil.c (main): Don't register writable keytab ops as they are diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c index c64a41cae..649002e21 100644 --- a/src/kadmin/ktutil/ktutil_funcs.c +++ b/src/kadmin/ktutil/ktutil_funcs.c @@ -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; }