Fixed a potential buffer overflow in the chat system.