From 2fbce8ad0a90398b3499085f6e3dbf8e9aae24e5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 16 Aug 2015 13:03:13 +0200 Subject: [PATCH] gensec: Fix CID 242642 Unchecked return value Signed-off-by: Volker Lendecke Reviewed-by: Ira Cooper --- auth/gensec/spnego.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c index 85c70e12f64..c111b85bb01 100644 --- a/auth/gensec/spnego.c +++ b/auth/gensec/spnego.c @@ -1184,6 +1184,7 @@ static NTSTATUS gensec_spnego_update_out(struct gensec_security *gensec_security { struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data; DATA_BLOB out = data_blob_null; + bool ok; *_out = data_blob_null; @@ -1222,7 +1223,11 @@ static NTSTATUS gensec_spnego_update_out(struct gensec_security *gensec_security /* * truncate the buffer */ - data_blob_realloc(spnego_state, &out, spnego_state->out_max_length); + ok = data_blob_realloc(spnego_state, &out, + spnego_state->out_max_length); + if (!ok) { + return NT_STATUS_NO_MEMORY; + } talloc_steal(out_mem_ctx, out.data); *_out = out; -- 2.11.4.GIT