From: Stefan Metzmacher Date: Wed, 17 Feb 2010 19:27:08 +0000 (+0100) Subject: libndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the... X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=b5f9c44da55abb28222441a7e064a2a25891981f libndr: give an error when ndr_push_relative_ptr2_start()/_end() is used with the RELATIVE_REVERSE flag metze --- diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 4e584e102bf..0ff43c3eb45 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"); } /*