aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-homeplug.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-18 18:27:07 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-18 18:27:07 +0000
commitf0a58ef5238d241643347371dddaed94c6b55e1b (patch)
tree9cd33897d1164b1239e9f2b1d88f4fdbd65bc88f /epan/dissectors/packet-homeplug.c
parent72e5288fddb32374ac700b234670caec14dbc525 (diff)
Call ptvcursor_new() to initialize cursor whether tree is NULL or not.
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9578 #BACKPORT(1.10, 1.8) svn path=/trunk/; revision=54227
Diffstat (limited to 'epan/dissectors/packet-homeplug.c')
-rw-r--r--epan/dissectors/packet-homeplug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-homeplug.c b/epan/dissectors/packet-homeplug.c
index 1a752d13b8..c2e01cb7fc 100644
--- a/epan/dissectors/packet-homeplug.c
+++ b/epan/dissectors/packet-homeplug.c
@@ -1312,7 +1312,7 @@ dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
proto_item * it= NULL;
proto_tree * homeplug_tree= NULL;
- ptvcursor_t * cursor= NULL;
+ ptvcursor_t * cursor;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HomePlug");
/* Clear out stuff in the info column */
@@ -1323,9 +1323,10 @@ dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (tree) {
it = proto_tree_add_item(tree, proto_homeplug, tvb, homeplug_offset, -1, ENC_NA);
homeplug_tree = proto_item_add_subtree(it, ett_homeplug);
- cursor = ptvcursor_new(homeplug_tree, tvb, 0);
}
+ cursor = ptvcursor_new(homeplug_tree, tvb, 0);
+
/* We do not have enough data to read mctrl field stop the dissection */
if (check_tvb_length(cursor, HOMEPLUG_MCTRL_LEN) != TVB_LEN_SHORTEST) {