diff options
author | Simo Sorce <simo@redhat.com> | 2013-04-03 14:57:59 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2013-04-03 16:39:11 -0400 |
commit | ca7a49fbefef59fe4839a83077a3abaa995c47d9 (patch) | |
tree | eb688dd304be2eb4808e13905bc667d23ff5be61 /proxy/src/mechglue | |
parent | d3bb4d70f00d429b21e481c7944a1851df14b9a4 (diff) | |
download | gss-proxy-ca7a49fbefef59fe4839a83077a3abaa995c47d9.tar.gz gss-proxy-ca7a49fbefef59fe4839a83077a3abaa995c47d9.tar.xz gss-proxy-ca7a49fbefef59fe4839a83077a3abaa995c47d9.zip |
Fix dereference after null checks found by Coverity
Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/src/mechglue')
-rw-r--r-- | proxy/src/mechglue/gpp_acquire_cred.c | 6 | ||||
-rw-r--r-- | proxy/src/mechglue/gpp_context.c | 4 |
2 files changed, 7 insertions, 3 deletions
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) { |