Fixed coredumping bug if size was NULL.
authorTheodore Tso <tytso@mit.edu>
Fri, 2 Nov 1990 10:34:40 +0000 (10:34 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 2 Nov 1990 10:34:40 +0000 (10:34 +0000)
Changed const krb5_principal to krb5_const_principal

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1398 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/unparse.c

index d16a2c52bacc5f1c0d6ba6882b6e4008c9d9cd64..380591accde90d20d668ff2bd8cb2c1b4c1a81d1 100644 (file)
@@ -44,7 +44,7 @@ static char rcsid_unparse_c[] =
 
 krb5_error_code
 krb5_unparse_name_ext(principal, name, size)
-const krb5_principal principal;
+krb5_const_principal principal;
 register char **name;
 int    *size;
 {
@@ -78,7 +78,8 @@ int   *size;
                }
        } else {
                *name = malloc(totalsize);      /* room for null */
-               *size = totalsize;
+               if (size)
+                       *size = totalsize;
        }
        
        if (!*name)
@@ -136,9 +137,10 @@ int        *size;
 
 krb5_error_code
 krb5_unparse_name(principal, name)
-const krb5_principal principal;
+krb5_const_principal principal;
 register char **name;
 {
+       *name = NULL;
        return(krb5_unparse_name_ext(principal, name, NULL));
 }