From b382008e52f4fe33feeaf95f0607a06b11d63d5a Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Thu, 31 Oct 2019 09:35:19 +1300 Subject: [PATCH] pidl: check the size of pulled arrays of arrays We were accidentally checking the memory just past the array instead of checking each member. This could have led to the size of some arrays not being checked. Signed-off-by: Douglas Bagnall Pair-programmed-with: Andrew Bartlett --- pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 2fc4327faf4..52bae491086 100644 --- pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1247,10 +1247,14 @@ sub ParseElementPullLevel if ($deferred and ContainsDeferred($e, $l)) { $self->pidl("for ($counter = 0; $counter < ($length); $counter++) {"); + $self->defer("for ($counter = 0; $counter < ($length); $counter++) {"); + $self->defer_indent; $self->indent; $self->ParseElementPullLevel($e,GetNextLevel($e,$l), $ndr, $var_name, $env, 0, 1); $self->deindent; + $self->defer_deindent; $self->pidl("}"); + $self->defer("}"); } $self->ParseMemCtxPullEnd($e, $l, $ndr); -- 2.20.1