Переглянути джерело

off-by-one array size error (SF #3010802)

James Wade 14 роки тому
батько
коміт
2748a22093
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      modules/Pisg/HTMLGenerator.pm

+ 1 - 1
modules/Pisg/HTMLGenerator.pm

@@ -1776,7 +1776,7 @@ sub _mostusedword
 
 
         my $count = 0;
         my $count = 0;
         for(my $i = 0; $count < $self->{cfg}->{wordhistory}; $i++) {
         for(my $i = 0; $count < $self->{cfg}->{wordhistory}; $i++) {
-            last unless $i < $#popular;
+            last unless $i < $#popular+1;
             # Skip nicks.  It's far more efficient to do this here than when
             # Skip nicks.  It's far more efficient to do this here than when
             # @popular is created.
             # @popular is created.
             next if is_ignored($popular[$i]);
             next if is_ignored($popular[$i]);