]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
leaking_addresses: explicitly name variable used in regex
authorTobin C. Harding <me@tobin.cc>
Thu, 1 Mar 2018 21:42:59 +0000 (08:42 +1100)
committerTobin C. Harding <me@tobin.cc>
Fri, 6 Apr 2018 22:50:34 +0000 (08:50 +1000)
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>
scripts/leaking_addresses.pl

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