validate block change buffer boundaries for chests

This commit is contained in:
Floof
2025-09-22 03:19:30 +02:00
committed by GitHub
parent 516a00f122
commit 450bef9e6c

View File

@@ -579,6 +579,8 @@ uint8_t makeBlockChange (short x, uint8_t y, short z, uint8_t block) {
// which naturally appends the chest to the end if a gap isn't found. // which naturally appends the chest to the end if a gap isn't found.
int last_real_entry = first_gap - 1; int last_real_entry = first_gap - 1;
for (int i = first_gap; i <= block_changes_count + 15; i ++) { for (int i = first_gap; i <= block_changes_count + 15; i ++) {
if (i >= MAX_BLOCK_CHANGES) break; // No more space, trigger failBlockChange
if (block_changes[i].block != 0xFF) { if (block_changes[i].block != 0xFF) {
last_real_entry = i; last_real_entry = i;
continue; continue;