diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-02-18 15:13:20 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-02-18 15:47:52 +0100 |
commit | 8310f02414efd3b792857ed20c636c4c114e1ba2 (patch) | |
tree | ad85e143cb012bbe33d615f2b0414b40f1123e5e /librpc/ndr | |
parent | 4a76d29374769ba4c075b8d5767498848d2e17d6 (diff) | |
download | samba-8310f02414efd3b792857ed20c636c4c114e1ba2.tar.gz samba-8310f02414efd3b792857ed20c636c4c114e1ba2.tar.bz2 samba-8310f02414efd3b792857ed20c636c4c114e1ba2.zip |
libndr: fix ndr_size_* calculation with relative reverse buffers
metze
Diffstat (limited to 'librpc/ndr')
-rw-r--r-- | librpc/ndr/ndr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 61745aa55a..b6110d52b4 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -1193,6 +1193,12 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, cons return NDR_ERR_SUCCESS; } + if (ndr->flags & LIBNDR_FLAG_NO_NDR_SIZE) { + /* better say more than calculation a too small buffer */ + NDR_PUSH_ALIGN(ndr, 8); + return NDR_ERR_SUCCESS; + } + if (ndr->relative_end_offset < ndr->offset) { return ndr_push_error(ndr, NDR_ERR_RELATIVE, "ndr_push_relative_ptr2_end:" |