aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-kdp.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-02-24 14:40:01 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-02-24 14:40:01 +0000
commitf2cd4937bce864aa3230cf5dd550f2e12c4bd9ae (patch)
tree6cb6ac42b924864aa34a5d7d14ffe87206a7e523 /epan/dissectors/packet-kdp.c
parentf75eaab39ffcf6678e900a79f68fd1ad736260bc (diff)
Initialize option_len to avoid a (false positive) unitialized variable warning.
svn path=/trunk/; revision=36047
Diffstat (limited to 'epan/dissectors/packet-kdp.c')
-rw-r--r--epan/dissectors/packet-kdp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dissectors/packet-kdp.c b/epan/dissectors/packet-kdp.c
index e735168a02..f556f8eb79 100644
--- a/epan/dissectors/packet-kdp.c
+++ b/epan/dissectors/packet-kdp.c
@@ -87,8 +87,8 @@ static void dissect_kdp(tvbuff_t *tvb,
guint8 packet_flags = 0;
guint8 packet_errors = 0;
guint32 sequence_number = G_MAXUINT32;
- guint32 ack_number = G_MAXUINT32;
- guint32 src_flowid = G_MAXUINT32;
+ guint32 ack_number = G_MAXUINT32;
+ guint32 src_flowid = G_MAXUINT32;
int offset;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KDP");
@@ -130,7 +130,7 @@ static void dissect_kdp(tvbuff_t *tvb,
proto_tree_add_item(flags_tree, hf_kdp_bcst_flag, tvb, 2, 1, FALSE);
proto_tree_add_item(flags_tree, hf_kdp_dup_flag, tvb, 2, 1, FALSE);
- proto_tree_add_item(kdp_tree, hf_kdp_errors, tvb, 3, 1, FALSE);
+ proto_tree_add_item(kdp_tree, hf_kdp_errors, tvb, 3, 1, FALSE);
if (header_len > 4) {
offset = 4;
@@ -160,10 +160,11 @@ static void dissect_kdp(tvbuff_t *tvb,
}
while (offset < ((body_len > 0) ? header_len - 4 : header_len)) {
- guint8 option_number, option_len;
+ guint8 option_number;
+ guint8 option_len = 0;
option_number = tvb_get_guint8(tvb, offset);
-
+
proto_tree_add_item(kdp_tree, hf_kdp_optionnumber, tvb, offset, 1, FALSE);
offset = offset + 1;
if (option_number > 0) {
@@ -216,7 +217,7 @@ static void dissect_kdp(tvbuff_t *tvb,
break;
}
}
-
+
if (body_len > 0) {
proto_tree_add_item(kdp_tree, hf_kdp_fragment, tvb, offset, 2, FALSE);
offset = offset + 2;