]> git.hungrycats.org Git - linux/commitdiff
scripts/get_maintainer.pl: fix possible infinite loop
authorJoe Perches <joe@perches.com>
Fri, 5 Mar 2010 21:43:07 +0000 (13:43 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Mar 2010 16:07:05 +0000 (09:07 -0700)
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>
scripts/get_maintainer.pl

index 2f3230db7ffbfd3044ceba5888e14bd77dc23148..049c4192058152e3e56a25d76d353a88f327cde3 100755 (executable)
@@ -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) {