diff options
Diffstat (limited to 'Utilities/cmcurl/lib/curl_gssapi.c')
-rw-r--r-- | Utilities/cmcurl/lib/curl_gssapi.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Utilities/cmcurl/lib/curl_gssapi.c b/Utilities/cmcurl/lib/curl_gssapi.c index 1543a0f..01ab48e 100644 --- a/Utilities/cmcurl/lib/curl_gssapi.c +++ b/Utilities/cmcurl/lib/curl_gssapi.c @@ -18,6 +18,8 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * + * SPDX-License-Identifier: curl + * ***************************************************************************/ #include "curl_setup.h" @@ -89,7 +91,7 @@ static size_t display_gss_error(OM_uint32 status, int type, OM_uint32 maj_stat; OM_uint32 min_stat; OM_uint32 msg_ctx = 0; - gss_buffer_desc status_string; + gss_buffer_desc status_string = GSS_C_EMPTY_BUFFER; do { maj_stat = gss_display_status(&min_stat, @@ -98,10 +100,12 @@ static size_t display_gss_error(OM_uint32 status, int type, GSS_C_NO_OID, &msg_ctx, &status_string); - if(GSS_LOG_BUFFER_LEN > len + status_string.length + 3) { - len += msnprintf(buf + len, GSS_LOG_BUFFER_LEN - len, - "%.*s. ", (int)status_string.length, - (char *)status_string.value); + if(maj_stat == GSS_S_COMPLETE && status_string.length > 0) { + if(GSS_LOG_BUFFER_LEN > len + status_string.length + 3) { + len += msnprintf(buf + len, GSS_LOG_BUFFER_LEN - len, + "%.*s. ", (int)status_string.length, + (char *)status_string.value); + } } gss_release_buffer(&min_stat, &status_string); } while(!GSS_ERROR(maj_stat) && msg_ctx); |