From 08efb0b674cb92c12d205b919e144d30ff26b655 Mon Sep 17 00:00:00 2001 From: p2r3 Date: Wed, 20 Aug 2025 18:59:40 +0300 Subject: [PATCH] fix out of bounds array access --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index e3936be..593aea5 100644 --- a/src/main.c +++ b/src/main.c @@ -257,7 +257,7 @@ void handlePacket (int client_fd, int length, int packet_id) { if (found) return; // Update player's recently visited chunks - for (int i = 0; i < VISITED_HISTORY; i ++) { + for (int i = 0; i < VISITED_HISTORY - 1; i ++) { player->visited_x[i] = player->visited_x[i + 1]; player->visited_z[i] = player->visited_z[i + 1]; }