9p strings are, not surprisingly, encoded using UTF-8; replace
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 21 Jan 2014 19:53:52 +0000 (19:53 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 21 Jan 2014 19:53:52 +0000 (19:53 +0000)
tvb_get_string() calls with tvb_get_string_enc() calls explicitly
specifying UTF-8.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@54876 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-9p.c

index eac0e95bf1ae0384321492b543505dbf52ab4ef9..c6f727343dbc5226462e037b0b00164137d7deec 100644 (file)
@@ -1275,7 +1275,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
                proto_tree_add_item(sub_tree, hf_9P_parmsz, tvb, offset, 2, ENC_LITTLE_ENDIAN);
 
                if (firstpass) {
-                       tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
+                       tvb_s = tvb_get_string_enc(NULL, tvb, offset+2, _9p_len, ENC_UTF_8);
 
                        if (!strncmp(tvb_s, "9P2000.L", _9p_len)) {
                                u32 = _9P2000_L;
@@ -1365,7 +1365,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
                sub_tree = proto_item_add_subtree(ti, ett_9P_aname);
                proto_tree_add_item(sub_tree, hf_9P_parmsz, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                if(firstpass) {
-                       tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
+                       tvb_s = tvb_get_string_enc(NULL, tvb, offset+2, _9p_len, ENC_UTF_8);
                        conv_set_fid(pinfo, fid, tvb_s, _9p_len+1);
                        g_free(tvb_s);
                }
@@ -1411,7 +1411,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
                        }
 
                        if (firstpass) {
-                               tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
+                               tvb_s = tvb_get_string_enc(NULL, tvb, offset+2, _9p_len, ENC_UTF_8);
                                wmem_strbuf_append_c(tmppath, '/');
                                wmem_strbuf_append(tmppath, tvb_s);
                                g_free(tvb_s);
@@ -1486,7 +1486,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
                        tmppath = wmem_strbuf_sized_new(wmem_packet_scope(), 0, MAXPATHLEN);
                        wmem_strbuf_append(tmppath, fid_path);
                        wmem_strbuf_append_c(tmppath, '/');
-                       tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
+                       tvb_s = tvb_get_string_enc(NULL, tvb, offset+2, _9p_len, ENC_UTF_8);
                        wmem_strbuf_append(tmppath, tvb_s);
                        g_free(tvb_s);
                }
@@ -1521,7 +1521,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
                        tmppath = wmem_strbuf_sized_new(wmem_packet_scope(), 0, MAXPATHLEN);
                        wmem_strbuf_append(tmppath, fid_path);
                        wmem_strbuf_append_c(tmppath, '/');
-                       tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
+                       tvb_s = tvb_get_string_enc(NULL, tvb, offset+2, _9p_len, ENC_UTF_8);
                        wmem_strbuf_append(tmppath, tvb_s);
                        g_free(tvb_s);
                }
@@ -1937,7 +1937,7 @@ static int dissect_9P(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
                        wmem_strbuf_append(tmppath, conv_get_fid(pinfo, dfid));
                        wmem_strbuf_append_c(tmppath, '/');
 
-                       tvb_s = tvb_get_string(NULL, tvb, offset+2, _9p_len);
+                       tvb_s = tvb_get_string_enc(NULL, tvb, offset+2, _9p_len, ENC_UTF_8);
                        wmem_strbuf_append(tmppath, tvb_s);
                        g_free(tvb_s);