ソースを参照

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 <joe@perches.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches 15 年 前
コミット
3c840c18bc
1 ファイル変更2 行追加2 行削除
  1. 2 2
      scripts/get_maintainer.pl

+ 2 - 2
scripts/get_maintainer.pl

@@ -347,6 +347,7 @@ foreach my $file (@files) {
 		if ($type eq 'X') {
 		if ($type eq 'X') {
 		    if (file_match_pattern($file, $value)) {
 		    if (file_match_pattern($file, $value)) {
 			$exclude = 1;
 			$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) {
     foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {