summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-09 10:33:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:28 -0500
commitb7f53e9d1807f854b6bd1b357bc4a20ab48a4a89 (patch)
treed4c72e303c9b1d6dc3d88173ce3d8fb85f7cc90d
parentf94aee4e8801700b82ad41f64b6b74c369760032 (diff)
downloadsamba-b7f53e9d1807f854b6bd1b357bc4a20ab48a4a89.tar.gz
samba-b7f53e9d1807f854b6bd1b357bc4a20ab48a4a89.tar.bz2
samba-b7f53e9d1807f854b6bd1b357bc4a20ab48a4a89.zip
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)
-rw-r--r--source4/librpc/rpc/dcerpc.c6
1 files changed, 6 insertions, 0 deletions
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;