From 07b69b102832cdea8c3ac1914e351394c8f171a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 6 Jul 2006 22:30:09 +0000 Subject: [PATCH] If the desired mechanism can't convert the name to a MN, fail with GSS_S_BAD_NAME rather then a NULL de-reference. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17812 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/mech/gss_init_sec_context.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gssapi/mech/gss_init_sec_context.c b/lib/gssapi/mech/gss_init_sec_context.c index 79750142d..04d16d33b 100644 --- a/lib/gssapi/mech/gss_init_sec_context.c +++ b/lib/gssapi/mech/gss_init_sec_context.c @@ -88,6 +88,11 @@ gss_init_sec_context(OM_uint32 * minor_status, * Find the MN for this mechanism. */ mn = _gss_find_mn(name, mech_type); + if (mn == NULL) { + if (allocated_ctx) + free(ctx); + return GSS_S_BAD_NAME; + } /* * If we have a cred, find the cred for this mechanism.