Fix a possible buffer overrun issue.