summaryrefslogtreecommitdiffstats
path: root/lib/libgssapi/gss_get_mic.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-20 00:49:37 +0000
committerpfg <pfg@FreeBSD.org>2016-04-20 00:49:37 +0000
commitd17a279cbdc8f21d9229f8e80ccefab5e925143d (patch)
tree0b21dc0d06a73941b4c0772f4610bae9526e42d2 /lib/libgssapi/gss_get_mic.c
parent89c6fc4bee45c341529e586ec35efae29be510a8 (diff)
downloadFreeBSD-src-d17a279cbdc8f21d9229f8e80ccefab5e925143d.zip
FreeBSD-src-d17a279cbdc8f21d9229f8e80ccefab5e925143d.tar.gz
MFC 297942:
libgssapi: avoid NULL pointer dereferences. While here also use NULL instead of zero for pointers.
Diffstat (limited to 'lib/libgssapi/gss_get_mic.c')
-rw-r--r--lib/libgssapi/gss_get_mic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libgssapi/gss_get_mic.c b/lib/libgssapi/gss_get_mic.c
index dff3b54..b55a796 100644
--- a/lib/libgssapi/gss_get_mic.c
+++ b/lib/libgssapi/gss_get_mic.c
@@ -40,13 +40,14 @@ gss_get_mic(OM_uint32 *minor_status,
gss_buffer_t message_token)
{
struct _gss_context *ctx = (struct _gss_context *) context_handle;
- struct _gss_mech_switch *m = ctx->gc_mech;
+ struct _gss_mech_switch *m;
_gss_buffer_zero(message_token);
if (ctx == NULL) {
*minor_status = 0;
return (GSS_S_NO_CONTEXT);
}
+ m = ctx->gc_mech;
return (m->gm_get_mic(minor_status, ctx->gc_ctx, qop_req,
message_buffer, message_token));
OpenPOWER on IntegriCloud