tools/csr: Fix possible buffer overflow

Make sure we don't write past the end of the array.
1 file changed