summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/parser.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index edecc24284..abf5785a45 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -547,6 +547,11 @@ sub ParseElementPullScalar($$$)
} else {
pidl "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $ndr_flags, $cprefix$var_prefix$e->{NAME}));\n";
}
+ if (my $range = util::has_property($e, "range")) {
+ my ($low, $high) = split(/ /, $range, 2);
+ pidl "\tif ($var_prefix$e->{NAME} < $low || $var_prefix$e->{NAME} > $high) {\n";
+ pidl "\t\treturn ndr_pull_error(ndr, NDR_ERR_RANGE, \"value out of range\");\n\t}\n";
+ }
end_flags($e);
}