From: Joe Perches Date: Fri, 5 Mar 2010 21:43:07 +0000 (-0800) Subject: scripts/get_maintainer.pl: fix possible infinite loop X-Git-Tag: Ubuntu-5.13.0-19.19~32592 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3c840c18bcd8efb37f1a565e83a9509e1ea5d105;p=mirror_ubuntu-jammy-kernel.git scripts/get_maintainer.pl: fix possible infinite loop 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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index b61002dceaba..f76f3d13276d 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -347,6 +347,7 @@ foreach my $file (@files) { if ($type eq 'X') { if (file_match_pattern($file, $value)) { $exclude = 1; + last; } } } @@ -373,8 +374,7 @@ foreach my $file (@files) { } } - $tvi += ($end - $start); - + $tvi = $end + 1; } foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {