Merge pull request #6791 from gco-bmx/fix-test-shrink-buffer-overflow

fix buffer overflow when running a test which shrinks a dynamic array…
This commit is contained in:
gingerBill
2026-06-07 10:11:00 +01:00
committed by GitHub

View File

@@ -344,7 +344,7 @@ rb_resize_bytes_non_zeroed :: proc(
}
}
result = rb_alloc_bytes_non_zeroed(stack, size, alignment) or_return
runtime.mem_copy_non_overlapping(raw_data(result), ptr, old_size)
runtime.mem_copy_non_overlapping(raw_data(result), ptr, min(old_size, size))
err = rb_free(stack, ptr)
return
}