Stop buffer overrun into undefined values detected by valgrind.