summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-21 22:00:00 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-21 22:00:00 +0000
commit0739d3dafdbc43f4c8f8adc2d2a216b7486971f1 (patch)
tree9c7cb0af8990290b862a0d83b2b883287fec36d1 /source4/librpc/ndr
parent7c5f6ead80fcee71e124229c6ba75b6e6d61928d (diff)
downloadsamba-0739d3dafdbc43f4c8f8adc2d2a216b7486971f1.tar.gz
samba-0739d3dafdbc43f4c8f8adc2d2a216b7486971f1.tar.bz2
samba-0739d3dafdbc43f4c8f8adc2d2a216b7486971f1.zip
cleaner handling of relative pointers to strings
(This used to be commit 4022e710755a61a3439f739a78fa6965b9b7788e)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index dcd0066083..b67fb25b1e 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -555,9 +555,9 @@ NTSTATUS ndr_pull_relative(struct ndr_pull *ndr, const void **buf, size_t size,
ndr_pull_save(ndr, &save);
NDR_CHECK(ndr_pull_set_offset(ndr, ofs + ndr->ofs_list->offset));
NDR_CHECK(ndr_pull_subcontext(ndr, &ndr2, ndr->data_size - ndr->offset));
- if (size == 1) {
- /* oh what a hack! */
- NDR_CHECK(fn(&ndr2, NDR_SCALARS|NDR_BUFFERS, (void *)&p));
+ /* strings must be allocated by the backend functions */
+ if (ndr->flags & LIBNDR_STRING_FLAGS) {
+ NDR_CHECK(fn(&ndr2, NDR_SCALARS|NDR_BUFFERS, &p));
} else {
NDR_ALLOC_SIZE(ndr, p, size);
NDR_CHECK(fn(&ndr2, NDR_SCALARS|NDR_BUFFERS, p));