Fix possible buffer overflow.