diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-11-03 11:24:18 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-11-03 19:24:52 +0000 |
commit | 58a325e282d311371e92a81ad1a05e49283f3eb1 (patch) | |
tree | b7e70bf01679a36add8b49599d2899095a436d0d /tools | |
parent | 0713d35bcd8037318295bc28f7cae68c82f4d92e (diff) |
Improve string delection in function ContainsString
Pick up patch from Samba:
commit 5740a06b320d56840439fb7fe3b8b27f341ddaa7
Author: Matthieu Patou <mat@matws.net>
Date: Sat Oct 4 21:19:12 2014 -0700
pidl: Improve string delection in function ContainsString
Change-Id: I702c12e4275315511728d5ef6db07e03be9c2b38
Reviewed-on: https://code.wireshark.org/review/5091
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/NDR.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/NDR.pm b/tools/pidl/lib/Parse/Pidl/NDR.pm index 682715227f..d65cbe7037 100644 --- a/tools/pidl/lib/Parse/Pidl/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/NDR.pm @@ -952,9 +952,19 @@ sub ContainsString($) if (property_matches($e, "flag", ".*STR_NULLTERM.*")) { return 1; } + if (exists($e->{LEVELS}) and $e->{LEVELS}->[0]->{TYPE} eq "ARRAY" and + ($e->{LEVELS}->[0]->{IS_FIXED} or $e->{LEVELS}->[0]->{IS_INLINE}) and + has_property($e, "charset")) + { + return 1; + } + foreach my $l (@{$e->{LEVELS}}) { return 1 if ($l->{TYPE} eq "ARRAY" and $l->{IS_ZERO_TERMINATED}); } + if (property_matches($e, "charset", ".*DOS.*")) { + return 1; + } return 0; } |