From f1cdeff37a7c1cc7534e6f00de45ae6770e01405 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 12 May 2022 14:12:41 +0200 Subject: [PATCH] gssapi: initialize gss_buffer_desc strings Explicitly initialize gss_buffer_desc strings such that a call to freeing resources will succeed even if no data has been allocated to it. Reported-by: Jay Satiro --- lib/curl_gssapi.c | 2 +- lib/socks_gssapi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index 52510f4433..92e208ea20 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -89,7 +89,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, diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index 8ef2f8f374..0895d94111 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -51,7 +51,7 @@ static int check_gss_err(struct Curl_easy *data, if(GSS_ERROR(major_status)) { OM_uint32 maj_stat, min_stat; OM_uint32 msg_ctx = 0; - gss_buffer_desc status_string; + gss_buffer_desc status_string = GSS_C_EMPTY_BUFFER; char buf[1024]; size_t len;