From ce0711805230c81f05e47f29a0a7afa1caf81116 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 2 Nov 1990 10:34:40 +0000 Subject: [PATCH] Fixed coredumping bug if size was NULL. 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/krb5/krb/unparse.c b/src/lib/krb5/krb/unparse.c index d16a2c52b..380591acc 100644 --- a/src/lib/krb5/krb/unparse.c +++ b/src/lib/krb5/krb/unparse.c @@ -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)); } -- 2.26.2