mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
pidl: Add recursive depth checks.
Add new parameter to elements "max_recursion" and modify pidl to call NDR_RECURSION_CHECK and NDR_RECURSION_UNWIND for element tagged with that attribute. Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19820 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14254 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
ba518a1deb
commit
5d323f2a2e
@ -1101,6 +1101,7 @@ my %property_list = (
|
||||
"gensize" => ["TYPEDEF", "STRUCT", "UNION"],
|
||||
"value" => ["ELEMENT"],
|
||||
"flag" => ["ELEMENT", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP", "PIPE"],
|
||||
"max_recursion" => ["ELEMENT"],
|
||||
|
||||
# generic
|
||||
"public" => ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP", "PIPE"],
|
||||
|
@ -993,7 +993,14 @@ sub ParseDataPull($$$$$$$)
|
||||
|
||||
$var_name = get_pointer_to($var_name);
|
||||
|
||||
if (my $depth = has_property($e, "max_recursion")) {
|
||||
my $d = parse_int($depth);
|
||||
$self->pidl("NDR_RECURSION_CHECK($ndr, $d);");
|
||||
}
|
||||
$self->pidl("NDR_CHECK(".TypeFunctionName("ndr_pull", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));");
|
||||
if (has_property($e, "max_recursion")) {
|
||||
$self->pidl("NDR_RECURSION_UNWIND($ndr);");
|
||||
}
|
||||
|
||||
my $pl = GetPrevLevel($e, $l);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user