mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/get_maintainer.pl: Fix possible infinite loop
@ 2010-02-23 17:31 Joe Perches
  2010-02-23 18:53 ` [PATCH V2] " Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2010-02-23 17:31 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

If MAINTAINERS section entries are misformatted,
it was possible to have an infinite loop.

Correct the defect by always moving at least one entry
forward in parsing the MAINTAINERS file.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/get_maintainer.pl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 2f3230d..4f2ec25 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -340,8 +340,11 @@ foreach my $file (@files) {
 	    }
 	}
 
-	$tvi += ($end - $start);
-
+	if ($end <= $start) {
+	    $tvi++;
+	} else {
+	    $tvi += ($end - $start);
+	}
     }
 
     foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
-- 
1.7.0.14.g7e948



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-23 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23 17:31 [PATCH] scripts/get_maintainer.pl: Fix possible infinite loop Joe Perches
2010-02-23 18:53 ` [PATCH V2] " Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®