[patch 110/123] scripts/get_maintainer.pl: fix possible infinite loop

From: Greg KH
Date: Fri Mar 12 2010 - 19:27:53 EST


2.6.33-stable review patch. If anyone has any objections, please let me know.

-----------------

From: Joe Perches <joe@xxxxxxxxxxx>

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@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
scripts/get_maintainer.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- 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) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/