1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00

added some paranoid checking for enums

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 9274ef60b6
commit 3492f37b0b

View File

@ -57,7 +57,8 @@ sub HeaderElement($)
}
}
if (defined $element->{ARRAY_LEN} &&
!util::is_constant($element->{ARRAY_LEN})) {
!util::is_constant($element->{ARRAY_LEN}) &&
!$element->{POINTERS}) {
# conformant arrays are ugly! I choose to implement them with
# pointers instead of the [1] method
$res .= "*";
@ -105,7 +106,9 @@ sub HeaderEnum($$)
my $e = ${$els}[$#{$els}];
tabs();
chomp $e;
$e =~ /^(.*?)\s*$/;
if ($e !~ /^(.*?)\s*$/) {
die "Bad enum $name\n";
}
$res .= "$1\n";
$tab_depth--;
$res .= "}";