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>
This commit is contained in:
Hadriel Kaplan 2014-03-31 23:58:04 -04:00 committed by Anders Broman
parent e7b3eff721
commit 914cbc2f3c
1 changed files with 2 additions and 1 deletions

View File

@ -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)