Skip to content

Commit

Permalink
gssapi: initialize gss_buffer_desc strings
Browse files Browse the repository at this point in the history
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 <raysatiro@yahoo.com>
  • Loading branch information
danielgustafsson committed May 12, 2022
1 parent 7360f9a commit f1cdeff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/curl_gssapi.c
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/socks_gssapi.c
Expand Up @@ -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;

Expand Down

1 comment on commit f1cdeff

@jay
Copy link
Member

@jay jay commented on f1cdeff May 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref: #8816
Ref: #8832

Please sign in to comment.