Commit 3c840c18 authored by Joe Perches's avatar Joe Perches Committed by 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: default avatarJoe Perches <joe@perches.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a63ceb4c
...@@ -347,6 +347,7 @@ foreach my $file (@files) { ...@@ -347,6 +347,7 @@ foreach my $file (@files) {
if ($type eq 'X') { if ($type eq 'X') {
if (file_match_pattern($file, $value)) { if (file_match_pattern($file, $value)) {
$exclude = 1; $exclude = 1;
last;
} }
} }
} }
...@@ -373,8 +374,7 @@ foreach my $file (@files) { ...@@ -373,8 +374,7 @@ foreach my $file (@files) {
} }
} }
$tvi += ($end - $start); $tvi = $end + 1;
} }
foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) { foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment