]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix an out of bounds array access.
authorRudolf Polzer <divVerent@gmail.com>
Wed, 30 Oct 2024 16:41:51 +0000 (12:41 -0400)
committerRudolf Polzer <divVerent@gmail.com>
Wed, 30 Oct 2024 16:41:51 +0000 (12:41 -0400)
qcsrc/server/chat.qc

index a702fa358ea286df894c937e0286c7d87deca065..e8bd537569c7930d63fbb9ed5df3b62da8f253c0 100644 (file)
@@ -408,7 +408,7 @@ entity findnearest(vector point, bool checkitems, vector axismod)
         //   INSERTION SORT! YOU'VE SEEN IT! RUN!
         if (l < NUM_NEAREST_ENTITIES)
         {
-            for (int j = NUM_NEAREST_ENTITIES - 1; j >= l; --j)
+            for (int j = NUM_NEAREST_ENTITIES - 2; j >= l; --j)
             {
                 nearest_length[j + 1] = nearest_length[j];
                 nearest_entity[j + 1] = nearest_entity[j];