From 6e3732104203ed72004d697686380e20db0898ef Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Tue, 10 Dec 2013 03:33:50 +0000 Subject: Reject the packet if data is NULL. svn path=/trunk/; revision=53899 --- epan/dissectors/packet-fcels.c | 7 ++++++- epan/dissectors/packet-fcfcs.c | 7 ++++++- epan/dissectors/packet-fcfzs.c | 7 ++++++- epan/dissectors/packet-fcp.c | 7 ++++++- epan/dissectors/packet-fcswils.c | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-fcels.c b/epan/dissectors/packet-fcels.c index 244caf9695..87ad5b0cfa 100644 --- a/epan/dissectors/packet-fcels.c +++ b/epan/dissectors/packet-fcels.c @@ -1846,7 +1846,12 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) guint options; address dstaddr; guint8 addrdata[3]; - fc_hdr *fchdr = (fc_hdr *)data; + fc_hdr *fchdr; + + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + fchdr = (fc_hdr *)data; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC ELS"); diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c index f858a4f8bc..ef86c94ea7 100644 --- a/epan/dissectors/packet-fcfcs.c +++ b/epan/dissectors/packet-fcfcs.c @@ -778,7 +778,12 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) fcfcs_conv_key_t ckey, *req_key; int opcode, failed_opcode = 0; - fc_hdr *fchdr = (fc_hdr *)data; + fc_hdr *fchdr; + + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + fchdr = (fc_hdr *)data; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FC-FCS"); diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c index b3f459325f..a6250cdbb9 100644 --- a/epan/dissectors/packet-fcfzs.c +++ b/epan/dissectors/packet-fcfzs.c @@ -593,7 +593,12 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) fcfzs_conv_data_t *cdata; fcfzs_conv_key_t ckey, *req_key; gboolean isreq = TRUE; - fc_hdr *fchdr = (fc_hdr *)data; + fc_hdr *fchdr; + + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + fchdr = (fc_hdr *)data; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Zone Server"); diff --git a/epan/dissectors/packet-fcp.c b/epan/dissectors/packet-fcp.c index 0dbfcbcc02..8569ce5c24 100644 --- a/epan/dissectors/packet-fcp.c +++ b/epan/dissectors/packet-fcp.c @@ -732,7 +732,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { proto_item *ti = NULL; proto_tree *fcp_tree = NULL; - fc_hdr *fchdr = (fc_hdr *)data; + fc_hdr *fchdr; guint8 r_ctl; conversation_t *fc_conv; fcp_conv_data_t *fcp_conv_data = NULL; @@ -740,6 +740,11 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) gboolean els; fcp_proto_data_t *proto_data; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + fchdr = (fc_hdr *)data; + /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCP"); diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index 27aecca580..c6dc254916 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -1771,7 +1771,12 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) proto_tree *swils_tree = NULL; guint8 isreq = FC_SWILS_REQ; tvbuff_t *next_tvb; - fc_hdr *fchdr = (fc_hdr *)data; + fc_hdr *fchdr; + + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + fchdr = (fc_hdr *)data; /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SW_ILS"); -- cgit v1.2.3