kdc: Check unparse_flags() result differently

This commit is contained in:
Nicolas Williams
2021-12-17 14:40:35 -06:00
committed by Luke Howard
parent 90899b2361
commit 27d6526e3a
2 changed files with 10 additions and 7 deletions

View File

@@ -1428,6 +1428,8 @@ tgs_build_reply(astgs_request_t priv,
Key *tkey_sign;
int flags = HDB_F_FOR_TGS_REQ;
int result;
memset(&sessionkey, 0, sizeof(sessionkey));
memset(&adtkt, 0, sizeof(adtkt));
memset(&enc_pa_data, 0, sizeof(enc_pa_data));
@@ -1460,10 +1462,10 @@ tgs_build_reply(astgs_request_t priv,
if (ret)
goto out;
cpn = priv->cname;
unparse_flags (KDCOptions2int(b->kdc_options),
asn1_KDCOptions_units(),
opt_str, sizeof(opt_str));
if(*opt_str)
result = unparse_flags(KDCOptions2int(b->kdc_options),
asn1_KDCOptions_units(),
opt_str, sizeof(opt_str));
if (result > 0)
kdc_log(context, config, 4,
"TGS-REQ %s from %s for %s [%s]",
cpn, from, spn, opt_str);