aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConnor Newton <c.newton@samsung.com>2019-10-11 16:26:54 +0100
committerAnders Broman <a.broman58@gmail.com>2019-10-14 06:48:35 +0000
commit5dd3c2b8ef2de97c3c262cb9006bffa9918bca9e (patch)
tree574d5933c9ba59d7f1db3e544cad5cdea198c31f
parent26354037a39104e2a23c3685619b8fbe922c3083 (diff)
Wi-Fi NAN: Fix defererence NULL in 802.11 channel set lookup
Bug: 16119 Change-Id: I1d10f6ff85c32490d069ba98121e1301c75ccbab Reviewed-on: https://code.wireshark.org/review/34760 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-wifi-nan.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-wifi-nan.c b/epan/dissectors/packet-wifi-nan.c
index bf6b4f526a..92a6a6de20 100644
--- a/epan/dissectors/packet-wifi-nan.c
+++ b/epan/dissectors/packet-wifi-nan.c
@@ -747,7 +747,6 @@ static const range_channel_set op_class_channel[] = {
{181, 191, {-1}},
{192, 254, {-2}},
{255, 255, {-1}},
- {0, 0, {0}}
};
static const range_string op_channel_spacing[] = {
@@ -1580,12 +1579,14 @@ dissect_attr_availability(proto_tree* attr_tree, tvbuff_t* tvb, gint offset, gui
{
if (bitmap & (1u << i_bitmap))
{
- gint channel = rval_to_channel_set(op_class, op_class_channel)[i_bitmap];
- if (!channel)
+
+ const gint *channel_set = rval_to_channel_set(op_class, op_class_channel);
+ if (channel_set == NULL)
{
expert_add_info(pinfo, channel_tree, &ei_nan_unknown_op_class);
break;
}
+ gint channel = channel_set[i_bitmap];
switch (channel)
{