diff options
Diffstat (limited to 'crypto/heimdal/lib/gssapi/display_status.c')
-rw-r--r-- | crypto/heimdal/lib/gssapi/display_status.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/crypto/heimdal/lib/gssapi/display_status.c b/crypto/heimdal/lib/gssapi/display_status.c index 1fa0531..fc1451d 100644 --- a/crypto/heimdal/lib/gssapi/display_status.c +++ b/crypto/heimdal/lib/gssapi/display_status.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: display_status.c,v 1.6 2001/05/11 09:16:46 assar Exp $"); +RCSID("$Id: display_status.c,v 1.7 2001/08/23 04:34:41 assar Exp $"); static char *krb5_error_string; @@ -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); |