30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
From c4f37d77b29ec6a9754795d0efb6f68d633728d9 Mon Sep 17 00:00:00 2001
|
|
From: John Thacker <johnthacker@gmail.com>
|
|
Date: Sat, 20 May 2023 23:08:08 -0400
|
|
Subject: [PATCH] synphasor: Use val_to_str_const
|
|
|
|
Don't use a value from packet data to directly index a value_string,
|
|
particularly when the value string doesn't cover all possible values.
|
|
|
|
Fix #19087
|
|
---
|
|
epan/dissectors/packet-synphasor.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c
|
|
index 536847f7502..fdc9e282b3a 100644
|
|
--- a/epan/dissectors/packet-synphasor.c
|
|
+++ b/epan/dissectors/packet-synphasor.c
|
|
@@ -1211,7 +1211,7 @@ static gint dissect_PHSCALE(tvbuff_t *tvb, proto_tree *tree, gint offset, gint c
|
|
|
|
data_flag_tree = proto_tree_add_subtree_format(single_phasor_scaling_and_flags_tree, tvb, offset, 4,
|
|
ett_conf_phflags, NULL, "Phasor Data flags: %s",
|
|
- conf_phasor_type[tvb_get_guint8(tvb, offset + 2)].strptr);
|
|
+ val_to_str_const(tvb_get_guint8(tvb, offset + 2), conf_phasor_type, "Unknown"));
|
|
|
|
/* first and second bytes - phasor modification flags*/
|
|
phasor_flag1_tree = proto_tree_add_subtree_format(data_flag_tree, tvb, offset, 2, ett_conf_phmod_flags,
|
|
--
|
|
GitLab
|
|
|