Skip to content

Commit

Permalink
scripts/get_maintainer.pl: fix possible infinite loop
Browse files Browse the repository at this point in the history
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: Joe Perches <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Mar 6, 2010
1 parent a63ceb4 commit 3c840c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/get_maintainer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
if ($type eq 'X') {
if (file_match_pattern($file, $value)) {
$exclude = 1;
last;
}
}
}
Expand All @@ -373,8 +374,7 @@
}
}

$tvi += ($end - $start);

$tvi = $end + 1;
}

foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
Expand Down

0 comments on commit 3c840c1

Please sign in to comment.