From ab6e3fce040f9ad27cbce44e9038a24f15b601c8 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sun, 15 Aug 2010 18:31:28 +0400 Subject: s4:heimdal: import lorikeet-heimdal-201009250123 (commit 42cabfb5b683dbcb97d583c397b897507689e382) I based this on Matthieu's import of lorikeet-heimdal, and then updated it to this commit. Andrew Bartlett --- source4/heimdal/lib/gssapi/mech/gss_display_status.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'source4/heimdal/lib/gssapi/mech/gss_display_status.c') diff --git a/source4/heimdal/lib/gssapi/mech/gss_display_status.c b/source4/heimdal/lib/gssapi/mech/gss_display_status.c index 60c5b8f523..d6aaf98827 100644 --- a/source4/heimdal/lib/gssapi/mech/gss_display_status.c +++ b/source4/heimdal/lib/gssapi/mech/gss_display_status.c @@ -135,7 +135,7 @@ supplementary_error(OM_uint32 v) } -OM_uint32 GSSAPI_LIB_FUNCTION +GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_status(OM_uint32 *minor_status, OM_uint32 status_value, int status_type, @@ -160,17 +160,18 @@ gss_display_status(OM_uint32 *minor_status, *minor_status = 0; switch (status_type) { case GSS_C_GSS_CODE: { - char *buf; + char *buf = NULL; + int e; if (GSS_SUPPLEMENTARY_INFO(status_value)) - asprintf(&buf, "%s", supplementary_error( + e = asprintf(&buf, "%s", supplementary_error( GSS_SUPPLEMENTARY_INFO(status_value))); else - asprintf (&buf, "%s %s", + e = asprintf (&buf, "%s %s", calling_error(GSS_CALLING_ERROR(status_value)), routine_error(GSS_ROUTINE_ERROR(status_value))); - if (buf == NULL) + if (e < 0 || buf == NULL) break; status_string->length = strlen(buf); @@ -181,21 +182,22 @@ gss_display_status(OM_uint32 *minor_status, case GSS_C_MECH_CODE: { OM_uint32 maj_junk, min_junk; gss_buffer_desc oid; - char *buf; + char *buf = NULL; + int e; maj_junk = gss_oid_to_str(&min_junk, mech_type, &oid); if (maj_junk != GSS_S_COMPLETE) { oid.value = rk_UNCONST("unknown"); oid.length = 7; } - - asprintf (&buf, "unknown mech-code %lu for mech %.*s", + + e = asprintf (&buf, "unknown mech-code %lu for mech %.*s", (unsigned long)status_value, (int)oid.length, (char *)oid.value); if (maj_junk == GSS_S_COMPLETE) gss_release_buffer(&min_junk, &oid); - if (buf == NULL) + if (e < 0 || buf == NULL) break; status_string->length = strlen(buf); -- cgit