提交 3c840c18 编写于 作者: J Joe Perches 提交者: Linus Torvalds

scripts/get_maintainer.pl: fix possible infinite loop

If MAINTAINERS section entries are misformatted, it was possible to have
an infinite loop.

Correct the defect by always moving the index to the end of section + 1

Also, exit check for exclude as soon as possible.
Signed-off-by: NJoe Perches <joe@perches.com>
Cc: <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a63ceb4c
......@@ -347,6 +347,7 @@ foreach my $file (@files) {
if ($type eq 'X') {
if (file_match_pattern($file, $value)) {
$exclude = 1;
last;
}
}
}
......@@ -373,8 +374,7 @@ foreach my $file (@files) {
}
}
$tvi += ($end - $start);
$tvi = $end + 1;
}
foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册