summaryrefslogtreecommitdiff
path: root/source3/librpc/ndr/ndr.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-02-27 17:17:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:13 -0500
commit7d2152b8dc160175939eeb3b943827f3b68928bd (patch)
tree6fe2017a539717303436ca26e98812b5b29794f8 /source3/librpc/ndr/ndr.c
parent81e4a28718632c1e5173ecb8b16db43cde439254 (diff)
downloadsamba-7d2152b8dc160175939eeb3b943827f3b68928bd.tar.gz
r21562: Regenerate gen_ndr after pidl changes.
(This used to be commit 952f648d8132a0652bb03b9e7671239e57614ee9)
Diffstat (limited to 'source3/librpc/ndr/ndr.c')
-rw-r--r--source3/librpc/ndr/ndr.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c
index f6a132c1861..5b9eba478a0 100644
--- a/source3/librpc/ndr/ndr.c
+++ b/source3/librpc/ndr/ndr.c
@@ -205,16 +205,13 @@ static void ndr_print_string_helper(struct ndr_print *ndr, const char *format, .
int i;
for (i=0;i<ndr->depth;i++) {
- ndr->private_data = talloc_asprintf_append(
- (char *)ndr->private_data, " ");
+ ndr->private_data = talloc_asprintf_append(ndr->private_data, " ");
}
va_start(ap, format);
- ndr->private_data = talloc_vasprintf_append(
- (char *)ndr->private_data, format, ap);
+ ndr->private_data = talloc_vasprintf_append(ndr->private_data, format, ap);
va_end(ap);
- ndr->private_data = talloc_asprintf_append(
- (char *)ndr->private_data, "\n");
+ ndr->private_data = talloc_asprintf_append(ndr->private_data, "\n");
}
/*
@@ -701,8 +698,8 @@ NTSTATUS ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, vo
}
status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
if (!NT_STATUS_IS_OK(status)) return status;
- if (ndr->offset != ndr->data_size) {
- return NT_STATUS_BUFFER_TOO_SMALL;
+ if (ndr->offset < ndr->data_size) {
+ return NT_STATUS_PORT_MESSAGE_TOO_LONG;
}
return status;
}
@@ -747,6 +744,8 @@ NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *
}
*blob = ndr_push_blob(ndr);
+ talloc_steal(mem_ctx, blob->data);
+ talloc_free(ndr);
return NT_STATUS_OK;
}
@@ -770,6 +769,8 @@ NTSTATUS ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
}
*blob = ndr_push_blob(ndr);
+ talloc_steal(mem_ctx, blob->data);
+ talloc_free(ndr);
return NT_STATUS_OK;
}