aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-edonkey.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-01-22 22:20:16 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2014-01-22 22:20:16 +0000
commit6d85633b15be005fe25d8cc4c0f78059cbce0c82 (patch)
treecc21b991ba392f961c891a517da3ca7e0e1bdcf6 /epan/dissectors/packet-edonkey.c
parent28a5c66d0a5204e58fc52a6de9d534a87cb48871 (diff)
edonkey seems to use 7-bit ascii for its tags etc
(not sure about one item that could contain arbitrary data...) svn path=/trunk/; revision=54912
Diffstat (limited to 'epan/dissectors/packet-edonkey.c')
-rw-r--r--epan/dissectors/packet-edonkey.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index 7296af1e0a..2a9b0d8a5a 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -599,7 +599,7 @@ static guint8 edonkey_metatag_name_get_type(tvbuff_t *tvb, gint start, gint leng
if (try_val_to_str(special_tagtype, edonkey_special_tags) == NULL) {
gint idx;
- tag_name = tvb_get_string(wmem_packet_scope(), tvb, start, length);
+ tag_name = tvb_get_string_enc(wmem_packet_scope(), tvb, start, length, ENC_ASCII|ENC_NA);
idx = lookup_str_index(tag_name, length, edonkey_special_tags);
if (idx < 0)
return EDONKEY_STAG_UNKNOWN;
@@ -916,7 +916,7 @@ static int dissect_kademlia_tagname(tvbuff_t *tvb, packet_info *pinfo _U_,
hidden_item = proto_tree_add_uint(tree, hf_edonkey_string_length, tvb, offset, 2, string_length);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- tagname = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, string_length );
+ tagname = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, string_length, ENC_ASCII|ENC_NA);
tag_full_name = "UnknownTagName";
@@ -926,7 +926,7 @@ static int dissect_kademlia_tagname(tvbuff_t *tvb, packet_info *pinfo _U_,
tag_full_name = val_to_str_const( tagname_value, kademlia_tags, tag_full_name );
}
- ti = proto_tree_add_item(tree, hf_kademlia_tag_name, tvb, offset+2, string_length, ENC_BIG_ENDIAN);
+ ti = proto_tree_add_item(tree, hf_kademlia_tag_name, tvb, offset + 2, string_length, ENC_BIG_ENDIAN);
proto_item_append_text(ti, " [%s]", tag_full_name);
if (outputTagName)
@@ -948,6 +948,7 @@ static int dissect_kademlia_string(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree_add_uint(tree, hf_edonkey_string_length, tvb, offset, 2, string_length);
+ /* TODO: ASCII or UTF-8? */
string_value = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, string_length );
proto_tree_add_text(tree, tvb, offset+2, string_length, "String: %s", string_value);
@@ -1087,9 +1088,9 @@ static int dissect_kademlia_tag_string(tvbuff_t *tvb, packet_info *pinfo _U_,
hidden_item = proto_tree_add_uint(tree, hf_edonkey_string_length, tvb, offset, 2, string_length);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- hidden_item = proto_tree_add_item(tree, hf_edonkey_string, tvb, offset+2, string_length, ENC_ASCII|ENC_NA);
+ hidden_item = proto_tree_add_item(tree, hf_edonkey_string, tvb, offset + 2, string_length, ENC_ASCII|ENC_NA);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- *string_value = tvb_get_string(wmem_packet_scope(), tvb, offset + 2, string_length);
+ *string_value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, string_length, ENC_ASCII|ENC_NA);
proto_tree_add_item(tree, hf_kademlia_tag_string, tvb, offset + 2, string_length, ENC_ASCII|ENC_NA);
return offset + 2 + string_length;