diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-22 08:41:40 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-22 08:41:40 +0000 |
commit | 175e9475796ca7f2ba1e8efad3e6975ad0c71882 (patch) | |
tree | a0c5bcc4466d88c2ead4bc5ab9053e47d345fddb /source4/build | |
parent | 86a604429ee13aa8c3f930ea74b1fada278ced45 (diff) | |
download | samba-175e9475796ca7f2ba1e8efad3e6975ad0c71882.tar.gz samba-175e9475796ca7f2ba1e8efad3e6975ad0c71882.tar.bz2 samba-175e9475796ca7f2ba1e8efad3e6975ad0c71882.zip |
* enable RPC/NDR validation in all smbtorture code
* allow us to distinguish between null arrays and zero length arrays,
by making the allocation size a minimum of 1 on array pull
(This used to be commit 11c0fe548ecfb03424f51e1354b86d4692e8f07c)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/parser.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index 79ee93509d..e12650dea2 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -288,14 +288,14 @@ sub ParseArrayPull($$$) if ((util::need_alloc($e) && !util::is_fixed_array($e)) || ($var_prefix eq "r->in." && util::has_property($e, "ref"))) { if (!util::is_inline_array($e) || $ndr_flags eq "NDR_SCALARS") { - pidl "\t\tNDR_ALLOC_N_SIZE(ndr, $var_prefix$e->{NAME}, $alloc_size, sizeof($var_prefix$e->{NAME}\[0]));\n"; + pidl "\t\tNDR_ALLOC_N_SIZE(ndr, $var_prefix$e->{NAME}, MAX(1, $alloc_size), sizeof($var_prefix$e->{NAME}\[0]));\n"; } } if (($var_prefix eq "r->out." && util::has_property($e, "ref"))) { if (!util::is_inline_array($e) || $ndr_flags eq "NDR_SCALARS") { pidl "\tif (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {"; - pidl "\t\tNDR_ALLOC_N_SIZE(ndr, $var_prefix$e->{NAME}, $alloc_size, sizeof($var_prefix$e->{NAME}\[0]));\n"; + pidl "\t\tNDR_ALLOC_N_SIZE(ndr, $var_prefix$e->{NAME}, MAX(1, $alloc_size), sizeof($var_prefix$e->{NAME}\[0]));\n"; pidl "\t}\n"; } } |