From b5f9c44da55abb28222441a7e064a2a25891981f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Feb 2010 20:27:08 +0100 Subject: libndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the RELATIVE_REVERSE flag metze --- librpc/ndr/ndr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'librpc/ndr') diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 4e584e102b..0ff43c3eb4 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -1160,7 +1160,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"); } /* -- cgit