summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/librpc/rpc/dcerpc.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index e763c81f13..28e48c4a5a 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -426,16 +426,9 @@ static NTSTATUS ncacn_push_request_sign(struct dcerpc_connection *c,
if (!NT_STATUS_IS_OK(status)) {
return status;
}
- status = data_blob_realloc(mem_ctx, blob,
- blob->length - c->security_state.auth_info->credentials.length +
- creds2.length);
-
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- memcpy(blob->data + blob->length - c->security_state.auth_info->credentials.length,
- creds2.data, creds2.length);
-
+ blob->length -= c->security_state.auth_info->credentials.length;
+ status = data_blob_append(mem_ctx, blob,
+ creds2.data, creds2.length);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -454,16 +447,9 @@ static NTSTATUS ncacn_push_request_sign(struct dcerpc_connection *c,
if (!NT_STATUS_IS_OK(status)) {
return status;
}
- status = data_blob_realloc(mem_ctx, blob,
- blob->length - c->security_state.auth_info->credentials.length +
- creds2.length);
-
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- memcpy(blob->data + blob->length - c->security_state.auth_info->credentials.length,
- creds2.data, creds2.length);
-
+ blob->length -= c->security_state.auth_info->credentials.length;
+ status = data_blob_append(mem_ctx, blob,
+ creds2.data, creds2.length);
if (!NT_STATUS_IS_OK(status)) {
return status;
}