krb5 commit: Check for null name_type in gss_display_name_ext
Greg Hudson
ghudson at mit.edu
Mon Aug 31 12:41:18 EDT 2015
https://github.com/krb5/krb5/commit/3fdf09ac9a36581b47f40c9d177e463cc12687ff
commit 3fdf09ac9a36581b47f40c9d177e463cc12687ff
Author: Solly Ross <sross at redhat.com>
Date: Thu Aug 27 15:55:35 2015 -0400
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.
ticket: 8238 (new)
target_version: 1.13.3
tags: pullup
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 =
More information about the cvs-krb5
mailing list