mms: fixed buffer overflow bug