From 0ad90967eb23066c1e346579f7476ed3c9d0582d Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Thu, 29 Oct 2015 17:44:47 -0400 Subject: Fix possible explicit NULL deref in gpm_accept_sec_context Signed-off-by: Robbie Harwood Reviewed-by: Simo Sorce --- proxy/src/client/gpm_accept_sec_context.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'proxy') 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) { -- cgit