pointer (this can happen when get_principal is passed a mask
without KADM5_PRINCIPAL in it, and will cause a beta 7 kadmind to
coredump)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9309
dc483132-0cff-0310-8789-
dd5450dbe970
+Wed Nov 6 17:45:43 1996 Barry Jaspan <bjaspan@mit.edu>
+
+ * kadm_rpc_xdr.c (xdr_krb5_principal): handle a NULL principal
+ pointer (this can happen when get_principal is passed a mask
+ without KADM5_PRINCIPAL in it, and will cause a beta 7 kadmind to
+ coredump)
+
Fri Nov 1 13:16:16 1996 Barry Jaspan <bjaspan@mit.edu>
* kadm_err.et: update for new tl_data semantics [krb5-admin/140]
switch(xdrs->x_op) {
case XDR_ENCODE:
- if((ret = krb5_unparse_name(context, *objp, &p)) != 0)
- return FALSE;
+ if (*objp) {
+ if((ret = krb5_unparse_name(context, *objp, &p)) != 0)
+ return FALSE;
+ }
if(!xdr_nullstring(xdrs, &p))
return FALSE;
- free(p);
+ if (p) free(p);
break;
case XDR_DECODE:
if(!xdr_nullstring(xdrs, &p))
return FALSE;
- ret = krb5_parse_name(context, p, &pr);
- if(ret != 0)
- return FALSE;
- *objp = pr;
- free(p);
+ if (p) {
+ ret = krb5_parse_name(context, p, &pr);
+ if(ret != 0)
+ return FALSE;
+ *objp = pr;
+ free(p);
+ } else
+ *objp = NULL;
break;
case XDR_FREE:
if(*objp != NULL)