From a7d3720050d32a5232d8e22029d7774a7854f059 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 11 Aug 2024 09:12:56 -0700 Subject: [PATCH] always null-terminate 81 command contents --- src/CommandFormats.hh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 1ac0300e..966e1ab3 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -1460,26 +1460,33 @@ struct SC_SimpleMail_PC_81 { // replied to. le_uint32_t player_tag = 0x00010000; le_uint32_t from_guild_card_number = 0; - pstring from_name; + pstring from_name; + le_uint16_t from_name_term = 0; le_uint32_t to_guild_card_number = 0; - pstring text; + pstring text; + le_uint16_t text_term = 0; } __packed_ws__(SC_SimpleMail_PC_81, 0x42C); struct SC_SimpleMail_DC_V3_81 { le_uint32_t player_tag = 0x00010000; le_uint32_t from_guild_card_number = 0; - pstring from_name; + pstring from_name; + uint8_t from_name_term = 0; le_uint32_t to_guild_card_number = 0; - pstring text; + pstring text; + uint8_t text_term = 0; } __packed_ws__(SC_SimpleMail_DC_V3_81, 0x21C); struct SC_SimpleMail_BB_81 { le_uint32_t player_tag = 0x00010000; le_uint32_t from_guild_card_number = 0; - pstring from_name; + pstring from_name; + le_uint16_t from_name_term = 0; le_uint32_t to_guild_card_number = 0; - pstring received_date; - pstring text; + pstring received_date; + le_uint16_t received_date_term = 0; + pstring text; + le_uint16_t text_term = 0; } __packed_ws__(SC_SimpleMail_BB_81, 0x454); // 82: Invalid command