From 62ac49eaddd6c75133488c02e26cf979e44b2232 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 30 Oct 2024 12:41:51 -0400 Subject: [PATCH] Fix an out of bounds array access. --- qcsrc/server/chat.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; -- 2.39.2