Fixed a possible buffer overflow issue