From c54f376268f49f0fceebe06c7079b75da3ed0e74 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 5 Mar 2010 13:43:07 -0800 Subject: scripts/get_maintainer.pl: fix possible infinite loop commit 3c840c18bcd8efb37f1a565e83a9509e1ea5d105 upstream. 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- scripts/get_maintainer.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 2f3230db7ffb..049c41920581 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -314,6 +314,7 @@ foreach my $file (@files) { if ($type eq 'X') { if (file_match_pattern($file, $value)) { $exclude = 1; + last; } } } @@ -340,8 +341,7 @@ foreach my $file (@files) { } } - $tvi += ($end - $start); - + $tvi = $end + 1; } foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) { -- cgit v1.2.3