diff options
author | Solly Ross <sross@redhat.com> | 2015-08-27 15:55:35 -0400 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2015-09-16 17:23:46 -0400 |
commit | ed0bb3902e1bea38bee829d37c7d4eaa5e4f2263 (patch) | |
tree | 3b9391ea00de097792298791d0e5e1f4ec0fc1a4 /src | |
parent | 6252a27c58f1aebde46436356a3d391e025bf250 (diff) | |
download | krb5-ed0bb3902e1bea38bee829d37c7d4eaa5e4f2263.zip krb5-ed0bb3902e1bea38bee829d37c7d4eaa5e4f2263.tar.gz krb5-ed0bb3902e1bea38bee829d37c7d4eaa5e4f2263.tar.bz2 |
Check for null name_type in gss_display_name_ext
It is possible for the input name's name_type to be GSS_C_NO_OID.
g_OID_equal() does not account for GSS_C_NO_OID, so we have to
manually check before use to prevent null pointer dereferences.
(cherry picked from commit 3fdf09ac9a36581b47f40c9d177e463cc12687ff)
ticket: 8238
version_fixed: 1.13.3
status: resolved
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/gssapi/mechglue/g_dsp_name_ext.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/gssapi/mechglue/g_dsp_name_ext.c b/src/lib/gssapi/mechglue/g_dsp_name_ext.c index 14326a3..be08dd1 100644 --- a/src/lib/gssapi/mechglue/g_dsp_name_ext.c +++ b/src/lib/gssapi/mechglue/g_dsp_name_ext.c @@ -94,6 +94,7 @@ gss_display_name_ext (OM_uint32 *minor_status, status = GSS_S_BAD_NAME; else if (mech->gss_display_name_ext == NULL) { if (mech->gss_display_name != NULL && + union_name->name_type != GSS_C_NO_OID && g_OID_equal(display_as_name_type, union_name->name_type)) { status = (*mech->gss_display_name)(minor_status, union_name->mech_name, @@ -114,7 +115,8 @@ gss_display_name_ext (OM_uint32 *minor_status, return status; } - if (!g_OID_equal(display_as_name_type, union_name->name_type)) + if (union_name->name_type == GSS_C_NO_OID || + !g_OID_equal(display_as_name_type, union_name->name_type)) return GSS_S_UNAVAILABLE; if ((output_name_buffer->value = |