From: Simon Ruderich Date: Tue, 15 Sep 2015 08:28:49 +0000 (+0200) Subject: fix false positive in `rm` lines X-Git-Tag: 0.06~8 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;ds=inline;h=3b0570352219e1c0cc5d15fa07892444c2561f11;hp=78f7218d807b87ede58fca00ca672ce597e2145e;p=blhc%2Fblhc.git fix false positive in `rm` lines Fixes Debian Bug #772853 reported by Jakub Wilk. --- diff --git a/NEWS b/NEWS index 818a4fc..223de68 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ Version 0.XX #784959), reported by Raphaël Hertzog. - Fix false positive with `gcc -v` (Debian Bug #765756), reported by Andreas Beckmann. +- Fix false positive in `rm` lines (Debian Bug #772853), reported by Jakub + Wilk. Version 0.05 diff --git a/bin/blhc b/bin/blhc index cc4f44b..4be8e84 100755 --- a/bin/blhc +++ b/bin/blhc @@ -952,6 +952,10 @@ foreach my $file (@ARGV) { # contains them. next if $line =~ m{^\s+/usr/lib/gcc/$cc_regex_full_prefix/ [0-9.]+/cc1(?:plus)?}xo; + # Ignore false positive with `rm` which may remove files which + # look like a compiler executable thus causing the line to be + # treated as a normal compiler line. + next if $line =~ m{^\s*rm\s+}; # Check if additional hardening options were used. Used to ensure # they are used for the complete build. diff --git a/t/logs/false-positives b/t/logs/false-positives index b0ac298..8ef70d6 100644 --- a/t/logs/false-positives +++ b/t/logs/false-positives @@ -6,6 +6,8 @@ swig -Wall -c++ -python test.i + CC=gcc CFLAGS=-g -O2 ... sh ../../build.sh -r -c lto +rm -f afl-gcc afl-as afl-fuzz afl-showmap as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test test-instr .test-instr0 .test-instr1 + # gcc -v can cause false positives. cd GUI && qmake /usr/bin/make -C GUI