aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-systemd-journal.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-11-18 15:55:01 -0800
committerAnders Broman <a.broman58@gmail.com>2018-11-21 04:33:44 +0000
commitd3aaea10f7e32dbed2e72232b4b269a89a135f20 (patch)
tree31dd7b4420660b9c82a13bc30445530eb9d0f8d1 /epan/dissectors/packet-systemd-journal.c
parentbf117224c2bbd09baa6aecd181bb67eac575061e (diff)
systemd Journal: Strings are UTF-8.
systemd Journal Export text fields are UTF-8. Use tvb_get_string_enc instead of tvb_format_text. Use col_add_str to add packet-scoped strings. Change-Id: I01d8d9127e6baf2f9c27d1e4a66071ec6173f181 Reviewed-on: https://code.wireshark.org/review/30708 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-systemd-journal.c')
-rw-r--r--epan/dissectors/packet-systemd-journal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-systemd-journal.c b/epan/dissectors/packet-systemd-journal.c
index 1c34e5ca61..8902619f5a 100644
--- a/epan/dissectors/packet-systemd-journal.c
+++ b/epan/dissectors/packet-systemd-journal.c
@@ -356,7 +356,7 @@ dissect_systemd_journal_line_entry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
}
if (hf_idx == hf_sj_message) {
col_clear(pinfo->cinfo, COL_INFO);
- col_set_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, eq_off, val_len));
+ col_add_str(pinfo->cinfo, COL_INFO, (char *) tvb_get_string_enc(wmem_packet_scope(), tvb, eq_off, val_len, ENC_UTF_8));
}
found = TRUE;
}
@@ -364,7 +364,7 @@ dissect_systemd_journal_line_entry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
if (!found && eq_off > offset + 1) {
proto_item *unk_ti = proto_tree_add_none_format(sje_tree, hf_sj_unkown_field, tvb, offset, line_len,
- "Unknown text field: %s", tvb_format_text(tvb, offset, eq_off - offset - 1));
+ "Unknown text field: %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, eq_off - offset - 1, ENC_UTF_8));
proto_tree *unk_tree = proto_item_add_subtree(unk_ti, ett_systemd_unknown_field);
proto_tree_add_item(unk_tree, hf_sj_unkown_field_name, tvb, offset, eq_off - offset - 1, ENC_UTF_8|ENC_NA);
proto_tree_add_item(unk_tree, hf_sj_unkown_field_value, tvb, eq_off, val_len, ENC_UTF_8|ENC_NA);
@@ -387,7 +387,7 @@ dissect_systemd_journal_line_entry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
proto_tree_add_item(bin_tree, hf_sj_binary_data_len, tvb, offset + noeql_len + 1, 8, ENC_LITTLE_ENDIAN);
if (hf_idx == hf_sj_message) {
col_clear(pinfo->cinfo, COL_INFO);
- col_set_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, data_off, (int) data_len));
+ col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, data_off, (int) data_len));
}
} else {
proto_item *unk_ti = proto_tree_add_none_format(sje_tree, hf_sj_unkown_field, tvb, offset, line_len,