Fixing buffer overflow which was caused by an invalid member in structure msg_t