aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-05 16:43:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-15 12:07:05 -0400
commitc54f376268f49f0fceebe06c7079b75da3ed0e74 (patch)
treecd5e5ff414dc2e4a4f4ec2a417bfbac9aabad315 /scripts
parenta8fe08331a02dda324267364d3f7cafb94ae60ff (diff)
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 <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get_maintainer.pl4
1 files 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) {
314 if ($type eq 'X') { 314 if ($type eq 'X') {
315 if (file_match_pattern($file, $value)) { 315 if (file_match_pattern($file, $value)) {
316 $exclude = 1; 316 $exclude = 1;
317 last;
317 } 318 }
318 } 319 }
319 } 320 }
@@ -340,8 +341,7 @@ foreach my $file (@files) {
340 } 341 }
341 } 342 }
342 343
343 $tvi += ($end - $start); 344 $tvi = $end + 1;
344
345 } 345 }
346 346
347 foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) { 347 foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {