From: Rudolf Polzer Date: Wed, 30 Oct 2024 16:41:51 +0000 (-0400) Subject: Fix an out of bounds array access. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=62ac49eaddd6c75133488c02e26cf979e44b2232;p=xonotic%2Fxonotic-data.pk3dir.git Fix an out of bounds array access. --- diff --git a/qcsrc/server/chat.qc b/qcsrc/server/chat.qc index a702fa358..e8bd53756 100644 --- a/qcsrc/server/chat.qc +++ b/qcsrc/server/chat.qc @@ -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];