瀏覽代碼

leaking_addresses: explicitly name variable used in regex

Currently sub routine may_leak_address() is checking regex against Perl
special variable $_ which is _fortunately_ being set correctly in a loop
before this sub routine is called.  We already have declared a variable
to hold this value '$line' we should use it.

Use $line in regex match instead of implicit $_

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Tobin C. Harding 7 年之前
父節點
當前提交
2306a67745
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/leaking_addresses.pl

+ 1 - 1
scripts/leaking_addresses.pl

@@ -363,7 +363,7 @@ sub may_leak_address
 	}
 	}
 
 
 	$address_re = get_address_re();
 	$address_re = get_address_re();
-	while (/($address_re)/g) {
+	while ($line =~ /($address_re)/g) {
 		if (!is_false_positive($1)) {
 		if (!is_false_positive($1)) {
 			return 1;
 			return 1;
 		}
 		}