From b7f53e9d1807f854b6bd1b357bc4a20ab48a4a89 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 9 Dec 2004 10:33:21 +0000 Subject: r4115: check for gensec errors before calling memcpy on a set of credentials, otherwise the creds structure might be invalid (This used to be commit 76285b3390f20366d53c7b2509ac07e1f88f7309) --- source4/librpc/rpc/dcerpc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/librpc/rpc') diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 3cd069c794..9217c90e0e 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -400,6 +400,9 @@ static NTSTATUS dcerpc_push_request_sign(struct dcerpc_pipe *p, blob->length - p->security_state.auth_info->credentials.length, &creds2); + if (!NT_STATUS_IS_OK(status)) { + return status; + } memcpy(blob->data + blob->length - creds2.length, creds2.data, creds2.length); break; @@ -412,6 +415,9 @@ static NTSTATUS dcerpc_push_request_sign(struct dcerpc_pipe *p, blob->length - p->security_state.auth_info->credentials.length, &creds2); + if (!NT_STATUS_IS_OK(status)) { + return status; + } memcpy(blob->data + blob->length - creds2.length, creds2.data, creds2.length); break; -- cgit