From 212af7e08ae655bdb36bb77dced8161dcfe09240 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Aug 2005 03:30:45 +0000 Subject: r9347: this array bounds checking is harder than it looks ... this copes with 2 more situations: 1) where the array is NULL, which would previously be coped with by a if (ptr) check, but now in the deferred array bounds checking needs to look at the array variable in the ndr code. Not nice. 2) nest the array checking along with the SCALARS vs BUFFERS checks, ensuring we don't do array bounds checking for a buffer when in scalars only mode (This used to be commit ad1b9867a5a14bc9ed2e1a5eb8f05bb2046bc645) --- source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm') diff --git a/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm b/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm index 87b99c5ef8..65b9ed57bc 100644 --- a/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm +++ b/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm @@ -1330,6 +1330,8 @@ sub ParseStructPull($$) ParseElementPull($e, "ndr", "r->", $env, 1, 0); } + add_deferred(); + deindent; pidl "}"; pidl "if (ndr_flags & NDR_BUFFERS) {"; @@ -1343,11 +1345,11 @@ sub ParseStructPull($$) ParseElementPull($e, "ndr", "r->", $env, 0, 1); } + add_deferred(); + deindent; pidl "}"; - add_deferred(); - end_flags($struct); # restore the old relative_base_offset pidl "ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);" if defined($struct->{PROPERTIES}{relative_base}); -- cgit