summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/build/pidl/parser.pm4
-rw-r--r--source4/torture/rpc/lsa.c2
-rw-r--r--source4/torture/rpc/samr.c2
-rw-r--r--source4/torture/torture.c3
4 files changed, 7 insertions, 4 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";
}
}
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 9512493181..178248a49b 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -539,7 +539,7 @@ BOOL torture_rpc_lsa(int dummy)
return False;
}
- p->flags |= DCERPC_DEBUG_PRINT_BOTH | DCERPC_DEBUG_VALIDATE_BOTH;
+ p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_OpenPolicy(p, mem_ctx)) {
ret = False;
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index ef7d9300d8..07faf2c165 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -902,7 +902,7 @@ BOOL torture_rpc_samr(int dummy)
return False;
}
- p->flags |= DCERPC_DEBUG_PRINT_BOTH | DCERPC_DEBUG_VALIDATE_BOTH;
+ p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_Connect(p, mem_ctx, &handle)) {
ret = False;
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index aa4af4b397..4fdfe8ccd5 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -153,6 +153,9 @@ NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p,
pipe_name, nt_errstr(status));
return status;
}
+
+ /* always do NDR validation in smbtorture */
+ (*p)->flags |= DCERPC_DEBUG_VALIDATE_BOTH;
return status;
}