From 0f5bf9b372ec8a64f4353f16a58d8bd8f1b2d826 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 25 Dec 1995 15:05:30 +0000 Subject: [PATCH] ktutil.c (ktutil_write_v4): Call ktutil_write_srvtab not ktutil_write_keytab ktutil_funcs.c (ktutil_write_srvtab): Clear malloced memory. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7250 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/ktutil/ChangeLog | 7 +++++++ src/kadmin/ktutil/ktutil.c | 2 +- src/kadmin/ktutil/ktutil_funcs.c | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/kadmin/ktutil/ChangeLog b/src/kadmin/ktutil/ChangeLog index 65eb38271..a83c9d580 100644 --- a/src/kadmin/ktutil/ChangeLog +++ b/src/kadmin/ktutil/ChangeLog @@ -1,3 +1,10 @@ +Mon Dec 25 10:03:15 1995 Ezra Peisach + + * ktutil.c (ktutil_write_v4): Call ktutil_write_srvtab not + ktutil_write_keytab. + + * ktutil_funcs.c (ktutil_write_srvtab): Clear malloced memory. + Thu Sep 07 15:06:57 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/kadmin/ktutil/ktutil.c b/src/kadmin/ktutil/ktutil.c index 2e53decd8..a295c8f22 100644 --- a/src/kadmin/ktutil/ktutil.c +++ b/src/kadmin/ktutil/ktutil.c @@ -140,7 +140,7 @@ void ktutil_write_v4(argc, argv) fprintf(stderr, "%s: must specify srvtab to write\n", argv[0]); return; } - retval = ktutil_write_keytab(kcontext, ktlist, argv[1]); + retval = ktutil_write_srvtab(kcontext, ktlist, argv[1]); if (retval) com_err(argv[0], retval, "while writing srvtab \"%s\"", argv[1]); #else diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c index 9143b7fb6..a5bb06bb1 100644 --- a/src/kadmin/ktutil/ktutil_funcs.c +++ b/src/kadmin/ktutil/ktutil_funcs.c @@ -114,6 +114,7 @@ krb5_error_code ktutil_read_keytab(context, name, list) retval = krb5_kt_next_entry(context, kt, entry, &cursor); if (retval) break; + if (!lp) { /* if list is empty, start one */ lp = (krb5_kt_list)malloc(sizeof (*lp)); if (!lp) { @@ -331,6 +332,7 @@ krb5_error_code ktutil_write_srvtab(context, list, name) pruned = (krb5_kt_list) malloc(sizeof (*pruned)); if (!pruned) return ENOMEM; + memset((char *) pruned, 0, sizeof(*pruned)); lp1 = pruned; } else { prev->next @@ -339,6 +341,7 @@ krb5_error_code ktutil_write_srvtab(context, list, name) retval = ENOMEM; goto free_pruned; } + memset((char *) prev->next, 0, sizeof(*pruned)); lp1 = prev->next; } lp1->entry = lp->entry; -- 2.26.2