diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-31 23:58:04 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-04-01 06:09:31 +0000 |
commit | 914cbc2f3c7dc54ecd4f441d1d300516cef02e58 (patch) | |
tree | 422fbc5a2b6e1774286a271e309b684b0c6d82b9 /tools | |
parent | e7b3eff7216de19efb74f7e8eb0c404c398d05e7 (diff) |
Fix checkApis perl script false positive proto_tree_add with ENC_*
In epan/proto.c in function proto_tree_add_split_bits_crumb, the
proto_tree_add_text function is called with one of its arguments
using ENC_BIG_ENDIAN, but it's not an argument for proto_tree_add_text
itself but instead a function being called inside it. checkAPIs.pl
tries to avoid this in check_proto_tree_add_XXX_encoding, by removing
parenthesis arguments, but in this acse there are newlines between
the arguments, causing the regex to not catch them. This commit
fixes the regex.
Change-Id: I70ef79d5436ba2ec04ffdc3d9939c7aa2cdf6a1f
Reviewed-on: https://code.wireshark.org/review/902
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/checkAPIs.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl index 2ef992d27c..f4bf70a82e 100755 --- a/tools/checkAPIs.pl +++ b/tools/checkAPIs.pl @@ -1621,7 +1621,8 @@ sub check_proto_tree_add_XXX_encoding($$) # Remove anything inside parenthesis in the arguments so we # don't get false positives when someone calls # proto_tree_add_XXX(..., tvb_YYY(..., ENC_ZZZ)) - $args =~ s/\(.*\)//g; + # and allow there to be newlines inside + $args =~ s/\(.*\)//sg; if ($args =~ /,\s*ENC_/xos) { if (!($func =~ /proto_tree_add_(item|bitmask|bits_item|bits_ret_val)/xos) |