← Commit list

c7fb5858a5

Viktor Szakats
Viktor Szakats
2025-10-04
FAILED Duration: 152s

Subject

checksrc: fix possible endless loops/errors in the banned function logic

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

scripts/checksrc.pl+3 -8
@@ -907,14 +907,9 @@ sub scanfile {
checkwarn("BANNEDFUNC",
$line, length($prefix), $file, $ol,
"use of $bad is banned");
- my $replace = 'x' x (length($bad) + 1);
- $prefix =~ s/\*/\\*/;
- $prefix =~ s/\[/\\[/;
- $prefix =~ s/\]/\\]/;
- $prefix =~ s/\(/\\(/;
- $prefix =~ s/\)/\\)/;
- $suff =~ s/\(/\\(/;
- $l =~ s/$prefix$bad$suff/$prefix$replace/;
+ my $search = quotemeta($prefix . $bad . $suff);
+ my $replace = $prefix . 'x' x (length($bad) + 1);
+ $l =~ s/$search/$replace/;
goto again;
}
$l = $bl; # restore to pre-bannedfunc content