From f6c43ee04d8f539290a54687963a01137f77fc40 Mon Sep 17 00:00:00 2001 From: Paul Park Date: Thu, 27 Jul 1995 17:39:07 +0000 Subject: [PATCH] Fix initialization of unparse_mod_princ_size git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6330 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/kdb_xdr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/kdb/kdb_xdr.c b/src/lib/kdb/kdb_xdr.c index 84ad28d48..2987a6a6f 100644 --- a/src/lib/kdb/kdb_xdr.c +++ b/src/lib/kdb/kdb_xdr.c @@ -67,6 +67,8 @@ krb5_dbe_encode_mod_princ_data(context, mod_princ, entry) &unparse_mod_princ)) return(retval); + unparse_mod_princ_size = (int) strlen(unparse_mod_princ) + 1; + if ((nextloc = malloc(unparse_mod_princ_size + 4)) == NULL) return ENOMEM; @@ -80,8 +82,6 @@ krb5_dbe_encode_mod_princ_data(context, mod_princ, entry) } } - unparse_mod_princ_size = strlen(unparse_mod_princ) + 1; - if ((*tl_data) || /* Only zero data if it is freshly allocated */ ((*tl_data) = (krb5_tl_data *)calloc(1, sizeof(krb5_tl_data)))) { @@ -128,7 +128,7 @@ krb5_dbe_decode_mod_princ_data(context, entry, mod_princ) *(((krb5_octet *)(&(*mod_princ)->mod_date)) + 3) = *nextloc++; /* Mod Princ */ - if (retval = krb5_parse_name(context, nextloc, + if (retval = krb5_parse_name(context, (const char *) nextloc, &((*mod_princ)->mod_princ))) break; if ((strlen(nextloc) + 1 + 4) != tl_data->tl_data_length) { -- 2.26.2