]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
leaking_addresses: do not parse binary files
authorTobin C. Harding <me@tobin.cc>
Sun, 18 Feb 2018 23:22:15 +0000 (10:22 +1100)
committerTobin C. Harding <me@tobin.cc>
Fri, 6 Apr 2018 22:50:34 +0000 (08:50 +1000)
Currently script parses binary files.  Since we are scanning for
readable kernel addresses there is no need to parse binary files.  We
can use Perl to check if file is binary and skip parsing it if so.

Do not parse binary files.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
scripts/leaking_addresses.pl

index 05906f6cf6b9561741ee5e815f34c22b4f3144e7..3d5c3096aac8f0a2537585fa9ccfee32c6556ccf 100755 (executable)
@@ -462,6 +462,10 @@ sub parse_file
                return;
        }
 
+       if (! -T $file) {
+               return;
+       }
+
        if (skip_parse($file)) {
                dprint "skipping file: $file\n";
                return;