From 773c36baa0ded91a75a046f6766acc3a8e45221c Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Tue, 11 May 2021 10:27:33 +1200 Subject: [PATCH] pidl: Parenthesize expression to be cast We must parenthesize each expression that is to be cast to a specific type, otherwise the cast will apply to only part of the full expression. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9914 Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index d5506d8c21d..a631bad3031 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -926,7 +926,7 @@ sub ParseElementPrint($$$$$) } else { my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; - $self->pidl("$ndr->print($ndr, \"%s: ARRAY(%\"PRIu32\")\", \"$e->{NAME}\", (uint32_t)$length);"); + $self->pidl("$ndr->print($ndr, \"%s: ARRAY(%\"PRIu32\")\", \"$e->{NAME}\", (uint32_t)($length));"); $self->pidl("$ndr->depth++;"); $self->pidl("for ($counter = 0; $counter < ($length); $counter++) {"); $self->indent; -- 2.47.3