From 6b50cd60dd642d58d9e2f5166d18d8d75355b241 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Feb 2010 20:27:08 +0100 Subject: [PATCH] libndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the RELATIVE_REVERSE flag metze (cherry picked from commit b5f9c44da55abb28222441a7e064a2a25891981f) (cherry picked from commit 2f8872bdff4f193043f5195f11ec6a8b44e0f8f1) --- librpc/ndr/ndr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index c3759985e83..15510d62162 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -1078,7 +1078,12 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, co if (p == NULL) { return NDR_ERR_SUCCESS; } - return ndr_push_relative_ptr2(ndr, p); + if (!(ndr->flags & LIBNDR_FLAG_RELATIVE_REVERSE)) { + return ndr_push_relative_ptr2(ndr, p); + } + + return ndr_push_error(ndr, NDR_ERR_RELATIVE, + "ndr_push_relative_ptr2_start RELATIVE_REVERSE flag set, but not supported"); } /* -- 2.11.4.GIT