summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-26 01:13:00 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-26 01:13:00 +0000
commit06942f3ddbb897c66644c253d1d2a7a21a31702e (patch)
tree13fc9c0695c68784b0b70d19ada578eefcd38952
parent49a85dc89093eee557a9d7eeffc2d8f3efa2b760 (diff)
downloadsamba-06942f3ddbb897c66644c253d1d2a7a21a31702e.tar.gz
samba-06942f3ddbb897c66644c253d1d2a7a21a31702e.tar.bz2
samba-06942f3ddbb897c66644c253d1d2a7a21a31702e.zip
added some paranoid checking for enums
(This used to be commit 3492f37b0bf14797514f1dc603f518bf5b801c3c)
-rw-r--r--source4/build/pidl/header.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index 5a75e4c9b4..c71b8fbeb1 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -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 .= "}";