ktutil.c (ktutil_write_v4): Call ktutil_write_srvtab not ktutil_write_keytab
authorEzra Peisach <epeisach@mit.edu>
Mon, 25 Dec 1995 15:05:30 +0000 (15:05 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 25 Dec 1995 15:05:30 +0000 (15:05 +0000)
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
src/kadmin/ktutil/ktutil.c
src/kadmin/ktutil/ktutil_funcs.c

index 65eb3827107247063d51e8da50fd5566ce91807c..a83c9d5800cadee2dbd0d5b17acdd0fc95659a34 100644 (file)
@@ -1,3 +1,10 @@
+Mon Dec 25 10:03:15 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
+
+       * 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)
 
index 2e53decd8d014846d081f8a70a2c98fc2fb66bce..a295c8f2262d008fdc4bd55a57a2bae57cce5ab2 100644 (file)
@@ -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
index 9143b7fb6a3a7eb59f0573e7aaef09aaf0800238..a5bb06bb15846b1dc3c2cc037ca7253f86e4a02b 100644 (file)
@@ -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;