From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] scripts/get_maintainer.pl: Fix possible infinite loop
Date: Tue, 23 Feb 2010 09:31:20 -0800 [thread overview]
Message-ID: <1266946280.9265.31.camel@Joe-Laptop.home> (raw)
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
next reply other threads:[~2010-02-23 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 17:31 Joe Perches [this message]
2010-02-23 18:53 ` [PATCH V2] " Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266946280.9265.31.camel@Joe-Laptop.home \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®