浏览代码

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]);