diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-13 21:08:02 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-13 21:08:02 +0000 |
commit | 378b205caf1973af41a5bb887820b862bbefa55e (patch) | |
tree | 8514b64e320ec177cc682e7beb87182f36110d47 /lib/libgssapi/gss_pseudo_random.c | |
parent | 4b40a9f9441eb83b76ace9dfa6730674a23d6cb4 (diff) | |
download | FreeBSD-src-378b205caf1973af41a5bb887820b862bbefa55e.zip FreeBSD-src-378b205caf1973af41a5bb887820b862bbefa55e.tar.gz |
libgssapi: avoid NULL pointer dereferences.
While here also use NULL instead of zero for pointers.
Found with coccinelle.
MFC after: 1 week
Diffstat (limited to 'lib/libgssapi/gss_pseudo_random.c')
-rw-r--r-- | lib/libgssapi/gss_pseudo_random.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libgssapi/gss_pseudo_random.c b/lib/libgssapi/gss_pseudo_random.c index c250d71..c746823 100644 --- a/lib/libgssapi/gss_pseudo_random.c +++ b/lib/libgssapi/gss_pseudo_random.c @@ -48,7 +48,7 @@ gss_pseudo_random(OM_uint32 *minor_status, gss_buffer_t prf_out) { struct _gss_context *ctx = (struct _gss_context *) context; - struct _gss_mech_switch *m = ctx->gc_mech; + struct _gss_mech_switch *m; OM_uint32 major_status; _gss_buffer_zero(prf_out); @@ -58,6 +58,7 @@ gss_pseudo_random(OM_uint32 *minor_status, *minor_status = 0; return GSS_S_NO_CONTEXT; } + m = ctx->gc_mech; if (m->gm_pseudo_random == NULL) return GSS_S_UNAVAILABLE; |