kdc: _kdc_do_kx509 prevent use of NULL cprincipal

If the return code is non-zero do not call krb5_unparse_name()
as cprincipal will be NULL.

Change-Id: I901b3f5dcdbc186f89257aef935b91e1d207119c
This commit is contained in:
Jeffrey Altman
2022-01-17 21:57:07 -05:00
parent 4b6fb5ab1a
commit d0e2467120

View File

@@ -940,7 +940,8 @@ _kdc_do_kx509(kx509_req_context r)
goto out;
}
ret = krb5_unparse_name(r->context, cprincipal, &r->cname);
if (ret == 0)
ret = krb5_unparse_name(r->context, cprincipal, &r->cname);
/* Check that the service name is a valid kx509 service name */
if (ret == 0)