diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-02-27 17:17:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:13 -0500 |
commit | 7d2152b8dc160175939eeb3b943827f3b68928bd (patch) | |
tree | 6fe2017a539717303436ca26e98812b5b29794f8 /source3/librpc/ndr | |
parent | 81e4a28718632c1e5173ecb8b16db43cde439254 (diff) | |
download | samba-7d2152b8dc160175939eeb3b943827f3b68928bd.tar.gz samba-7d2152b8dc160175939eeb3b943827f3b68928bd.tar.bz2 samba-7d2152b8dc160175939eeb3b943827f3b68928bd.zip |
r21562: Regenerate gen_ndr after pidl changes.
(This used to be commit 952f648d8132a0652bb03b9e7671239e57614ee9)
Diffstat (limited to 'source3/librpc/ndr')
-rw-r--r-- | source3/librpc/ndr/libndr.h | 1 | ||||
-rw-r--r-- | source3/librpc/ndr/ndr.c | 17 | ||||
-rw-r--r-- | source3/librpc/ndr/ndr_basic.c | 1 |
3 files changed, 11 insertions, 8 deletions
diff --git a/source3/librpc/ndr/libndr.h b/source3/librpc/ndr/libndr.h index 32dd0ef6c5..3c2377f57f 100644 --- a/source3/librpc/ndr/libndr.h +++ b/source3/librpc/ndr/libndr.h @@ -93,6 +93,7 @@ struct ndr_push { struct ndr_token_list *switch_list; struct ndr_token_list *relative_list; struct ndr_token_list *nbt_string_list; + struct ndr_token_list *full_ptr_list; /* this is used to ensure we generate unique reference IDs */ uint32_t ptr_count; diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c index f6a132c186..5b9eba478a 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; } diff --git a/source3/librpc/ndr/ndr_basic.c b/source3/librpc/ndr/ndr_basic.c index 5e75fa1092..7fc290e595 100644 --- a/source3/librpc/ndr/ndr_basic.c +++ b/source3/librpc/ndr/ndr_basic.c @@ -799,5 +799,6 @@ NTSTATUS ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob uint32_t ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags) { + if (!data) return ret; return ret + data->length; } |