aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5/krb/parse.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1992-05-29 03:25:04 +0000
committerTheodore Tso <tytso@mit.edu>1992-05-29 03:25:04 +0000
commit5c213170ad8576d1ee341eb4bc06e6e6da32072b (patch)
treea749bd54e99356682de8df71ac8a4ebc8fbd6612 /src/lib/krb5/krb/parse.c
parent3e3fbc03ca3161eb0d211e876a39a0f61a8f0d7b (diff)
downloadkrb5-5c213170ad8576d1ee341eb4bc06e6e6da32072b.zip
krb5-5c213170ad8576d1ee341eb4bc06e6e6da32072b.tar.gz
krb5-5c213170ad8576d1ee341eb4bc06e6e6da32072b.tar.bz2
Fixed fence post errors; assigned the principal type
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2280 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/parse.c')
-rw-r--r--src/lib/krb5/krb/parse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c
index 3613975..b1aacb2 100644
--- a/src/lib/krb5/krb/parse.c
+++ b/src/lib/krb5/krb/parse.c
@@ -196,20 +196,21 @@ krb5_parse_name(name, nprincipal)
* usual case), then just copy the sizes to the
* principal structure
*/
- for (i=0; i <= components; i++)
+ for (i=0; i < components; i++)
krb5_princ_component(principal, i)->length = fcompsize[i];
+ krb5_princ_realm(principal)->length = size;
}
/*
* Now, we need to allocate the space for the strings themselves.....
*/
- tmpdata = malloc(realmsize);
+ tmpdata = malloc(realmsize+1);
if (tmpdata == 0) {
xfree(principal->data);
xfree(principal);
return ENOMEM;
}
krb5_princ_set_realm_data(principal, tmpdata);
- for (i=0; i <= components; i++) {
+ for (i=0; i < components; i++) {
char *tmpdata =
malloc(krb5_princ_component(principal, i)->length + 1);
if (!tmpdata) {
@@ -265,6 +266,7 @@ krb5_parse_name(name, nprincipal)
* Alright, we're done. Now stuff a pointer to this monstrosity
* into the return variable, and let's get out of here.
*/
+ krb5_princ_type(principal) = KRB5_NT_PRINCIPAL;
*nprincipal = principal;
return(0);
}