From 31b3e7004d7c6e23f8d0e45a388c3e73269eca5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 9 Apr 2006 18:38:13 +0000 Subject: [PATCH] Check that cred != GSS_C_NO_CREDENTIAL, this is a standard conformance failure, but much better then a crash. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17026 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/add_cred.c | 5 +++++ lib/gssapi/krb5/add_cred.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/gssapi/add_cred.c b/lib/gssapi/add_cred.c index 5850ed2aa..f015e40dc 100644 --- a/lib/gssapi/add_cred.c +++ b/lib/gssapi/add_cred.c @@ -64,6 +64,11 @@ OM_uint32 gss_add_cred ( return GSS_S_NO_CRED; } + if (cred == GSS_C_NO_CREDENTIAL) { /* XXX standard conformance failure */ + *minor_status = 0; + return GSS_S_NO_CRED; + } + /* check if requested output usage is compatible with output usage */ if (output_cred_handle != NULL) { HEIMDAL_MUTEX_lock(&cred->cred_id_mutex); diff --git a/lib/gssapi/krb5/add_cred.c b/lib/gssapi/krb5/add_cred.c index 5850ed2aa..f015e40dc 100644 --- a/lib/gssapi/krb5/add_cred.c +++ b/lib/gssapi/krb5/add_cred.c @@ -64,6 +64,11 @@ OM_uint32 gss_add_cred ( return GSS_S_NO_CRED; } + if (cred == GSS_C_NO_CREDENTIAL) { /* XXX standard conformance failure */ + *minor_status = 0; + return GSS_S_NO_CRED; + } + /* check if requested output usage is compatible with output usage */ if (output_cred_handle != NULL) { HEIMDAL_MUTEX_lock(&cred->cred_id_mutex);