diff options
-rw-r--r-- | proxy/src/gp_conv.c | 7 | ||||
-rw-r--r-- | proxy/src/gp_socket.c | 2 | ||||
-rw-r--r-- | proxy/src/mechglue/gpp_acquire_cred.c | 6 | ||||
-rw-r--r-- | proxy/src/mechglue/gpp_context.c | 4 |
4 files changed, 13 insertions, 6 deletions
diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c index f402ba7..cccfe16 100644 --- a/proxy/src/gp_conv.c +++ b/proxy/src/gp_conv.c @@ -300,7 +300,7 @@ int gp_conv_err_to_gssx_string(uint32_t status, int type, gss_OID oid, ret_maj = gss_display_status(&ret_min, status, type, oid, &msg_ctx, &gssbuf); - if (ret_maj == 0) { + if (ret_maj == GSS_S_COMPLETE) { if (str) { ret = asprintf(&t, "%s, %s", str, (char *)gssbuf.value); if (ret == -1) { @@ -316,9 +316,10 @@ int gp_conv_err_to_gssx_string(uint32_t status, int type, gss_OID oid, } } gss_release_buffer(&ret_min, &gssbuf); - } - if (ret_maj) { + } else { ret = EINVAL; + } + if (ret) { goto done; } } while (msg_ctx); diff --git a/proxy/src/gp_socket.c b/proxy/src/gp_socket.c index 8bb71d1..20a13c5 100644 --- a/proxy/src/gp_socket.c +++ b/proxy/src/gp_socket.c @@ -75,6 +75,8 @@ struct gp_creds *gp_conn_get_creds(struct gp_conn *conn) void gp_conn_free(struct gp_conn *conn) { + if (!conn) return; + if (conn->us.sd != -1) { close(conn->us.sd); } diff --git a/proxy/src/mechglue/gpp_acquire_cred.c b/proxy/src/mechglue/gpp_acquire_cred.c index b3a46ec..43eca8c 100644 --- a/proxy/src/mechglue/gpp_acquire_cred.c +++ b/proxy/src/mechglue/gpp_acquire_cred.c @@ -256,6 +256,10 @@ OM_uint32 gssi_acquire_cred_with_password(OM_uint32 *minor_status, GSSI_TRACE(); + if (desired_name == GSS_C_NO_NAME) { + *minor_status = gpp_map_error(EINVAL); + return GSS_S_BAD_NAME; + } name = (struct gpp_name_handle *)desired_name; if (!output_cred_handle) { @@ -289,7 +293,7 @@ OM_uint32 gssi_acquire_cred_with_password(OM_uint32 *minor_status, goto done; } - if (name && name->remote && !name->local) { + if (name->remote && !name->local) { maj = gpp_name_to_local(&min, name->remote, name->mech_type, &name->local); if (maj) { diff --git a/proxy/src/mechglue/gpp_context.c b/proxy/src/mechglue/gpp_context.c index 90dc897..448c3e0 100644 --- a/proxy/src/mechglue/gpp_context.c +++ b/proxy/src/mechglue/gpp_context.c @@ -320,8 +320,8 @@ OM_uint32 gssi_set_sec_context_option(OM_uint32 *minor_status, GSSI_TRACE(); - if (context_handle) { - ctx = (struct gpp_context_handle *)context_handle; + if (*context_handle) { + ctx = (struct gpp_context_handle *)(*context_handle); } else { ctx = calloc(1, sizeof(struct gpp_context_handle)); if (!ctx) { |