From: Paul Park Date: Thu, 27 Jul 1995 17:39:07 +0000 (+0000) Subject: Fix initialization of unparse_mod_princ_size X-Git-Tag: krb5-1.0-beta6~1490 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f6c43ee04d8f539290a54687963a01137f77fc40;p=krb5.git Fix initialization of unparse_mod_princ_size git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6330 dc483132-0cff-0310-8789-dd5450dbe970 --- 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) {