summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wow.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:44:18 +0000
commit1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f (patch)
tree9930fb4bb87cd6037f60efff9656f967121c8c2d /epan/dissectors/packet-wow.c
parentAdding debian version 4.2.2-1.1. (diff)
downloadwireshark-1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f.tar.xz
wireshark-1da76b3706a6c9bd41bf8f219d7c97de5e1e5c7f.zip
Merging upstream version 4.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--epan/dissectors/packet-wow.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/epan/dissectors/packet-wow.c b/epan/dissectors/packet-wow.c
index c6725341..80aa430d 100644
--- a/epan/dissectors/packet-wow.c
+++ b/epan/dissectors/packet-wow.c
@@ -460,7 +460,6 @@ parse_logon_reconnect_challenge_server_to_client(tvbuff_t *tvb, proto_tree *wow_
static void
parse_logon_challenge_client_to_server(packet_info *pinfo, tvbuff_t *tvb, proto_tree *wow_tree, guint32 offset) {
guint8 srp_i_len;
- char buffer[5];
gchar *string;
proto_tree_add_item(wow_tree, hf_wow_protocol_version, tvb,
@@ -471,10 +470,16 @@ parse_logon_challenge_client_to_server(packet_info *pinfo, tvbuff_t *tvb, proto_
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5);
- string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4);
+ string = tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII);
+ /* g_utf8_strreverse handles the REPLACMENT CHARACTERs.
+ * It would handle embedded NULs correctly if we passed in the
+ * byte length after conversion, but we need to change the API
+ * to use counted strings in more places.
+ */
+ string = g_utf8_strreverse(string, -1);
proto_tree_add_string(wow_tree, hf_wow_gamename,
tvb, offset, 4, string);
+ g_free(string);
offset += 4;
@@ -498,22 +503,25 @@ parse_logon_challenge_client_to_server(packet_info *pinfo, tvbuff_t *tvb, proto_
offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5);
- string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4);
+ string = tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII);
+ string = g_utf8_strreverse(string, -1);
proto_tree_add_string(wow_tree, hf_wow_platform,
tvb, offset, 4, string);
+ g_free(string);
offset += 4;
- tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5);
- string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4);
+ string = tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII);
+ string = g_utf8_strreverse(string, -1);
proto_tree_add_string(wow_tree, hf_wow_os, tvb,
offset, 4, string);
+ g_free(string);
offset += 4;
- tvb_get_raw_bytes_as_string(tvb, offset, buffer, 5);
- string = get_ascii_string(pinfo->pool, g_strreverse(buffer), 4);
+ string = tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII);
+ string = g_utf8_strreverse(string, -1);
proto_tree_add_string(wow_tree, hf_wow_country,
tvb, offset, 4, string);
+ g_free(string);
offset += 4;
proto_tree_add_item(wow_tree,