aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/profinet/packet-pn-dcp.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-03-08 10:59:05 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-03-08 10:59:05 +0000
commit3a92bf963c829bb3db93ecf351e15c4f91832149 (patch)
treea950c3f89222891d07a70f12898557ea6eaa785a /plugins/profinet/packet-pn-dcp.c
parentcdc088fb660405e87d1aaa670f149b55e35c2d86 (diff)
fix coverity bug 122
svn path=/trunk/; revision=17527
Diffstat (limited to 'plugins/profinet/packet-pn-dcp.c')
-rw-r--r--plugins/profinet/packet-pn-dcp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/profinet/packet-pn-dcp.c b/plugins/profinet/packet-pn-dcp.c
index 25c3566e53..d970975470 100644
--- a/plugins/profinet/packet-pn-dcp.c
+++ b/plugins/profinet/packet-pn-dcp.c
@@ -676,7 +676,7 @@ dissect_PNDCP_Suboption_All(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, proto_item *block_item, proto_item *dcp_item, int length)
{
guint8 suboption;
- guint16 block_length;
+ guint16 block_length=0;
offset = dissect_pn_uint8(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_all, &suboption);
length--;
@@ -692,9 +692,11 @@ dissect_PNDCP_Suboption_All(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_item_append_text(block_item, "All/All");
break;
default:
- proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
- "Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_ALLSELECTOR, suboption, block_length);
- offset += block_length;
+ if(block_length){
+ proto_tree_add_string_format(tree, hf_pn_dcp_data, tvb, offset, block_length, "data",
+ "Block data(0x%x/0x%x): %d bytes", PNDCP_OPTION_ALLSELECTOR, suboption, block_length);
+ offset += block_length;
+ }
}
return offset;