Skip to content

Commit 450bef9

Browse files
authored
validate block change buffer boundaries for chests
1 parent 516a00f commit 450bef9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/procedures.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ uint8_t makeBlockChange (short x, uint8_t y, short z, uint8_t block) {
579579
// which naturally appends the chest to the end if a gap isn't found.
580580
int last_real_entry = first_gap - 1;
581581
for (int i = first_gap; i <= block_changes_count + 15; i ++) {
582+
if (i >= MAX_BLOCK_CHANGES) break; // No more space, trigger failBlockChange
583+
582584
if (block_changes[i].block != 0xFF) {
583585
last_real_entry = i;
584586
continue;

0 commit comments

Comments
 (0)