diff options
author | Simo Sorce <simo@redhat.com> | 2013-04-03 09:07:39 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2013-04-03 16:39:11 -0400 |
commit | 970213ad87e9d1c89c2388964336a1fb7106f590 (patch) | |
tree | 0e9036393a861cc6e4a9e1acd72527cf2837f30c | |
parent | 1cba7ee0c4cc92ea1fb618f139568ca64a8ee799 (diff) | |
download | gss-proxy-970213ad87e9d1c89c2388964336a1fb7106f590.tar.gz gss-proxy-970213ad87e9d1c89c2388964336a1fb7106f590.tar.xz gss-proxy-970213ad87e9d1c89c2388964336a1fb7106f590.zip |
Fix unchecked return values found by Coverity
Signed-off-by: Simo Sorce <simo@redhat.com>
-rw-r--r-- | proxy/src/client/gpm_get_mic.c | 7 | ||||
-rw-r--r-- | proxy/src/client/gpm_verify_mic.c | 14 | ||||
-rw-r--r-- | proxy/src/gp_rpc_get_mic.c | 7 |
3 files changed, 24 insertions, 4 deletions
diff --git a/proxy/src/client/gpm_get_mic.c b/proxy/src/client/gpm_get_mic.c index 9c0d4f8..36d819a 100644 --- a/proxy/src/client/gpm_get_mic.c +++ b/proxy/src/client/gpm_get_mic.c @@ -52,7 +52,12 @@ OM_uint32 gpm_get_mic(OM_uint32 *minor_status, /* NOTE: the final free will also release the old context */ arg->context_handle = *context_handle; arg->qop_req = qop_req; - gp_conv_buffer_to_gssx(message_buffer, &arg->message_buffer); + ret = gp_conv_buffer_to_gssx(message_buffer, &arg->message_buffer); + if (ret) { + ret_maj = GSS_S_FAILURE; + ret_min = ret; + goto done; + } /* execute proxy request */ ret = gpm_make_call(GSSX_GET_MIC, &uarg, &ures); diff --git a/proxy/src/client/gpm_verify_mic.c b/proxy/src/client/gpm_verify_mic.c index 4ce6227..57c71ab 100644 --- a/proxy/src/client/gpm_verify_mic.c +++ b/proxy/src/client/gpm_verify_mic.c @@ -51,8 +51,18 @@ OM_uint32 gpm_verify_mic(OM_uint32 *minor_status, /* format request */ /* NOTE: the final free will also release the old context */ arg->context_handle = *context_handle; - gp_conv_buffer_to_gssx(message_buffer, &arg->message_buffer); - gp_conv_buffer_to_gssx(message_token, &arg->token_buffer); + ret = gp_conv_buffer_to_gssx(message_buffer, &arg->message_buffer); + if (ret) { + ret_maj = GSS_S_FAILURE; + ret_min = ret; + goto done; + } + ret = gp_conv_buffer_to_gssx(message_token, &arg->token_buffer); + if (ret) { + ret_maj = GSS_S_FAILURE; + ret_min = ret; + goto done; + } /* execute proxy request */ ret = gpm_make_call(GSSX_VERIFY, &uarg, &ures); diff --git a/proxy/src/gp_rpc_get_mic.c b/proxy/src/gp_rpc_get_mic.c index ca352ab..9f37731 100644 --- a/proxy/src/gp_rpc_get_mic.c +++ b/proxy/src/gp_rpc_get_mic.c @@ -91,7 +91,12 @@ int gp_get_mic(struct gssproxy_ctx *gpctx, /* what is the point of returning an input parameter ? - gd */ *gmr->qop_state = gma->qop_req; - gp_conv_buffer_to_gssx(&message_token, &gmr->token_buffer); + ret = gp_conv_buffer_to_gssx(&message_token, &gmr->token_buffer); + if (ret) { + ret_maj = GSS_S_FAILURE; + ret_min = ret; + goto done; + } ret_maj = GSS_S_COMPLETE; ret_min = 0; |