(gss_display_status): handle krb5_get_err_text failing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10532 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -129,21 +129,25 @@ OM_uint32 gss_display_status
|
||||
asprintf (&buf, "%s %s",
|
||||
calling_error(GSS_CALLING_ERROR(status_value)),
|
||||
routine_error(GSS_ROUTINE_ERROR(status_value)));
|
||||
if (buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
} else if (status_type == GSS_C_MECH_CODE) {
|
||||
buf = gssapi_krb5_get_error_string ();
|
||||
if (buf == NULL)
|
||||
buf = strdup(krb5_get_err_text (gssapi_krb5_context, status_value));
|
||||
if (buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
const char *tmp = krb5_get_err_text (gssapi_krb5_context,
|
||||
status_value);
|
||||
if (tmp == NULL)
|
||||
asprintf(&buf, "unknown mech error-code %u",
|
||||
(unsigned)status_value);
|
||||
else
|
||||
buf = strdup(tmp);
|
||||
}
|
||||
} else
|
||||
return GSS_S_BAD_STATUS;
|
||||
|
||||
if (buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
*message_context = 0;
|
||||
|
||||
status_string->length = strlen(buf);
|
||||
|
@@ -129,21 +129,25 @@ OM_uint32 gss_display_status
|
||||
asprintf (&buf, "%s %s",
|
||||
calling_error(GSS_CALLING_ERROR(status_value)),
|
||||
routine_error(GSS_ROUTINE_ERROR(status_value)));
|
||||
if (buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
} else if (status_type == GSS_C_MECH_CODE) {
|
||||
buf = gssapi_krb5_get_error_string ();
|
||||
if (buf == NULL)
|
||||
buf = strdup(krb5_get_err_text (gssapi_krb5_context, status_value));
|
||||
if (buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
const char *tmp = krb5_get_err_text (gssapi_krb5_context,
|
||||
status_value);
|
||||
if (tmp == NULL)
|
||||
asprintf(&buf, "unknown mech error-code %u",
|
||||
(unsigned)status_value);
|
||||
else
|
||||
buf = strdup(tmp);
|
||||
}
|
||||
} else
|
||||
return GSS_S_BAD_STATUS;
|
||||
|
||||
if (buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
*message_context = 0;
|
||||
|
||||
status_string->length = strlen(buf);
|
||||
|
Reference in New Issue
Block a user