tests: Fix buffer overrun