Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity fixes #61

Merged
merged 3 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gp_rpc_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void gpdbg_gssx_OID(gssx_OID *x)
if (GSS_ERROR(maj)) {
gp_debug_printf("<BAD OID> ");
} else {
gp_debug_printf("%.*s ", oidbuf.length, (char *)oidbuf.value);
gp_debug_printf("%.*s ", (int)oidbuf.length, (char *)oidbuf.value);
}
maj = gss_release_buffer(&min, &oidbuf);
}
Expand Down
4 changes: 2 additions & 2 deletions src/gp_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ static void gp_socket_write(verto_ctx *vctx, verto_ev *ev)
/* don't bother trying to handle sockets that can't
* buffer even 4 bytes */
GPDEBUGN(3, "[status] Sending data [%p (%zu)]: failed with short "
"write of %d\n", wbuf->data, wbuf->size, wn);
"write of %z\n", wbuf->data, wbuf->size, wn);
gp_conn_free(wbuf->conn);
gp_buffer_free(wbuf);
return;
Expand All @@ -630,7 +630,7 @@ static void gp_socket_write(verto_ctx *vctx, verto_ev *ev)
}
wbuf->pos += wn;

GPDEBUGN(3, "[status] Sending data [%p (%zu)]: successful write of %d\n",
GPDEBUGN(3, "[status] Sending data [%p (%zu)]: successful write of %z\n",
wbuf->data, wbuf->size, wn);


Expand Down
60 changes: 30 additions & 30 deletions src/mechglue/gss_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,35 @@ gss_OID_set gss_mech_interposer(gss_OID mech_type)
gss_OID_set interposed_mechs;
OM_uint32 maj, min;

if (!enabled()) return NULL;

interposed_mechs = NULL;
maj = 0;
if (gss_oid_equal(&gssproxy_mech_interposer, mech_type)) {
maj = gss_create_empty_oid_set(&min, &interposed_mechs);
if (maj != 0) {
return NULL;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_krb5),
&interposed_mechs);
if (maj != 0) {
goto done;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_krb5_old),
&interposed_mechs);
if (maj != 0) {
goto done;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_krb5_wrong),
&interposed_mechs);
if (maj != 0) {
goto done;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_iakerb),
&interposed_mechs);
if (maj != 0) {
goto done;
}
if (!enabled()) return GSS_C_NO_OID_SET;

if (!gss_oid_equal(&gssproxy_mech_interposer, mech_type)) {
return GSS_C_NO_OID_SET;
}

maj = gss_create_empty_oid_set(&min, &interposed_mechs);
if (maj != 0) {
return GSS_C_NO_OID_SET;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_krb5),
&interposed_mechs);
if (maj != 0) {
goto done;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_krb5_old),
&interposed_mechs);
if (maj != 0) {
goto done;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_krb5_wrong),
&interposed_mechs);
if (maj != 0) {
goto done;
}
maj = gss_add_oid_set_member(&min, no_const(&gpoid_iakerb),
&interposed_mechs);
if (maj != 0) {
goto done;
}

/* while there also initiaize special_mechs */
Expand All @@ -130,7 +130,7 @@ gss_OID_set gss_mech_interposer(gss_OID mech_type)
done:
if (maj != 0) {
(void)gss_release_oid_set(&min, &interposed_mechs);
interposed_mechs = NULL;
interposed_mechs = GSS_C_NO_OID_SET;
}

return interposed_mechs;
Expand Down