diff options
author | Robbie Harwood <rharwood@redhat.com> | 2015-10-29 17:44:47 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-10-29 17:52:08 -0400 |
commit | 0ad90967eb23066c1e346579f7476ed3c9d0582d (patch) | |
tree | 3f84636d3574e5636adb0199b568c48ed8d46d62 | |
parent | 461a5fa9f91a2753ebeef6323a64239c35e2f250 (diff) | |
download | gss-proxy-0ad90967eb23066c1e346579f7476ed3c9d0582d.tar.gz gss-proxy-0ad90967eb23066c1e346579f7476ed3c9d0582d.tar.xz gss-proxy-0ad90967eb23066c1e346579f7476ed3c9d0582d.zip |
Fix possible explicit NULL deref in gpm_accept_sec_context
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
-rw-r--r-- | proxy/src/client/gpm_accept_sec_context.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/proxy/src/client/gpm_accept_sec_context.c b/proxy/src/client/gpm_accept_sec_context.c index bbacd5a..375ee17 100644 --- a/proxy/src/client/gpm_accept_sec_context.c +++ b/proxy/src/client/gpm_accept_sec_context.c @@ -74,11 +74,13 @@ OM_uint32 gpm_accept_sec_context(OM_uint32 *minor_status, } } - if (res->context_handle) { - ctx = res->context_handle; - /* we are stealing the delegated creds on success, so we do not want - * it to be freed by xdr_free */ - res->context_handle = NULL; + ctx = res->context_handle; + /* we are stealing the delegated creds on success, so we do not want + * it to be freed by xdr_free */ + res->context_handle = NULL; + if (ctx == NULL) { + ret = EINVAL; + goto done; } if (src_name) { |