aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x29.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-10 22:04:30 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-10 22:04:30 +0000
commit3ec7cbf4d091793749f597e2022b97d7c8eb0f21 (patch)
tree7f5b2ec45df12a872ccdd19fc2a9a86502d482fc /epan/dissectors/packet-x29.c
parent90f5deac446c805a071d61271ad616aadcfbb2ef (diff)
Reject the packet if data is NULL.
svn path=/trunk/; revision=53924
Diffstat (limited to 'epan/dissectors/packet-x29.c')
-rw-r--r--epan/dissectors/packet-x29.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/epan/dissectors/packet-x29.c b/epan/dissectors/packet-x29.c
index 02820ccd52..0bb2faaff8 100644
--- a/epan/dissectors/packet-x29.c
+++ b/epan/dissectors/packet-x29.c
@@ -79,15 +79,20 @@ static int
dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
int offset = 0;
- proto_tree *x29_tree;
- proto_item *ti;
- gboolean *q_bit_set = (gboolean *)data;
+ proto_tree *x29_tree;
+ proto_item *ti;
+ gboolean *q_bit_set;
guint8 msg_code;
guint8 error_type;
guint8 type_ref;
gint next_offset;
int linelen;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ q_bit_set = (gboolean *)data;
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "X.29");
col_clear(pinfo->cinfo, COL_INFO);
@@ -253,12 +258,12 @@ proto_register_x29(void)
{ "Invalid message code", "x29.inv_msg_code", FT_UINT8, BASE_HEX,
VALS(message_code_vals), 0x0, "X.29 Error PAD message invalid message code",
HFILL }},
- };
+ };
static gint *ett[] = {
&ett_x29,
};
- proto_x29 = proto_register_protocol("X.29", "X.29", "x29");
+ proto_x29 = proto_register_protocol("X.29", "X.29", "x29");
proto_register_field_array(proto_x29, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}