Skip to content

Commit

Permalink
X509_verify_cert can return without setting cert_ctx.current_cert. If
Browse files Browse the repository at this point in the history
it does, don't dereference a null pointer when creating the pkiDebug
message.


git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24296 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
ghudson committed Sep 8, 2010
1 parent a49ceff commit 4feb417
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,8 +1319,11 @@ cms_signeddata_verify(krb5_context context,
default:
retval = KRB5KDC_ERR_INVALID_CERTIFICATE;
}
X509_NAME_oneline(X509_get_subject_name(
reqctx->received_cert), buf, sizeof(buf));
if (reqctx->received_cert == NULL)
strlcpy(buf, "(none)", sizeof(buf));
else
X509_NAME_oneline(X509_get_subject_name(reqctx->received_cert),
buf, sizeof(buf));
pkiDebug("problem with cert DN = %s (error=%d) %s\n", buf, j,
X509_verify_cert_error_string(j));
krb5_set_error_message(context, retval, "%s\n",
Expand Down

0 comments on commit 4feb417

Please sign in to comment.