diff options
Diffstat (limited to 'epan/dissectors/packet-ms-mms.c')
-rw-r--r-- | epan/dissectors/packet-ms-mms.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c index 85353a9166..4c3ba7de4c 100644 --- a/epan/dissectors/packet-ms-mms.c +++ b/epan/dissectors/packet-ms-mms.c @@ -431,7 +431,7 @@ static gint dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Protocol name. Must be "MMS"... */ if (strncmp((char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 3, ENC_ASCII), "MMS", 3) != 0) { - return 0; + return offset; } proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_protocol_type, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; @@ -796,11 +796,11 @@ static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, pro static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) { - guint32 server_version_length; - guint32 tool_version_length; - guint32 download_update_player_length; - guint32 password_encryption_type_length; - char *server_version; + guint32 server_version_length; + guint32 tool_version_length; + guint32 download_update_player_length; + guint32 password_encryption_type_length; + const guint8 *server_version; /* ErrorCode */ proto_tree_add_item(tree, hf_msmms_command_prefix1_error, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -842,12 +842,10 @@ static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t /* Server version string. */ if (server_version_length > 1) { - server_version = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, server_version_length*2, ENC_UTF_16|ENC_LITTLE_ENDIAN); - /* Server version string */ - proto_tree_add_item(tree, hf_msmms_command_server_version, tvb, + proto_tree_add_item_ret_string(tree, hf_msmms_command_server_version, tvb, offset, server_version_length*2, - ENC_UTF_16|ENC_LITTLE_ENDIAN); + ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &server_version); col_append_fstr(pinfo->cinfo, COL_INFO, " (version='%s')", format_text((guchar*)server_version, strlen(server_version))); @@ -887,7 +885,7 @@ static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint length_remaining) { - char *player_info; + const guint8 *player_info; /* Flags */ proto_tree_add_item(tree, hf_msmms_command_prefix1, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -899,11 +897,9 @@ static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_ offset += 4; /* Extract and show the string in tree and info column */ - player_info = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length_remaining - 12, ENC_UTF_16|ENC_LITTLE_ENDIAN); - - proto_tree_add_item(tree, hf_msmms_command_client_player_info, tvb, + proto_tree_add_item_ret_string(tree, hf_msmms_command_client_player_info, tvb, offset, length_remaining-12, - ENC_UTF_16|ENC_LITTLE_ENDIAN); + ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &player_info); col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", format_text((guchar*)player_info, strlen(player_info))); @@ -964,7 +960,7 @@ static void dissect_timing_test_response(tvbuff_t *tvb, proto_tree *tree, guint static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint length_remaining) { - char *server_file; + const guint8 *server_file; /* Command Level */ proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -976,11 +972,9 @@ static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto offset += 4; /* File path on server */ - server_file = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length_remaining - 16, ENC_UTF_16|ENC_LITTLE_ENDIAN); - - proto_tree_add_item(tree, hf_msmms_command_server_file, tvb, + proto_tree_add_item_ret_string(tree, hf_msmms_command_server_file, tvb, offset, length_remaining-16, - ENC_UTF_16|ENC_LITTLE_ENDIAN); + ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &server_file); col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", format_text((guchar*)server_file, strlen(server_file))); |