summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-07-13 16:16:35 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-07-25 13:51:10 +0200
commit6a3c50f368979c8bf5dc6c8c88bf34227c61a56e (patch)
tree9e739613e0a4fc21bae1e1264db078b43c5ce4a7 /auth
parent1ff538124dc9b8785591002937c2b59ee6c07d8c (diff)
downloadsamba-6a3c50f368979c8bf5dc6c8c88bf34227c61a56e.tar.gz
auth/spnego: add more error checking to gensec_spnego_create_negTokenInit()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'auth')
-rw-r--r--auth/gensec/spnego.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c
index 6d033705037..c91ae3833d0 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -224,11 +224,20 @@ static NTSTATUS gensec_spnego_create_negTokenInit(struct gensec_security *gensec
mechTypes = gensec_security_oids(gensec_security,
out_mem_ctx, GENSEC_OID_SPNEGO);
+ if (mechTypes == NULL) {
+ DBG_WARNING("gensec_security_oids() failed\n");
+ return NT_STATUS_NO_MEMORY;
+ }
all_sec = gensec_security_by_oid_list(gensec_security,
out_mem_ctx,
mechTypes,
GENSEC_OID_SPNEGO);
+ if (all_sec == NULL) {
+ DBG_WARNING("gensec_security_by_oid_list() failed\n");
+ return NT_STATUS_NO_MEMORY;
+ }
+
for (i=0; all_sec && all_sec[i].op; i++) {
const char *next = NULL;
const char *principal = NULL;
@@ -308,6 +317,10 @@ reply:
send_mech_types = gensec_security_oids_from_ops_wrapped(out_mem_ctx,
&all_sec[i]);
+ if (send_mech_types == NULL) {
+ DBG_WARNING("gensec_security_oids_from_ops_wrapped() failed\n");
+ return NT_STATUS_NO_MEMORY;
+ }
ok = spnego_write_mech_types(spnego_state,
send_mech_types,