From edce8204d13a47f4e510466cd69b4b25c4a8641a Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Mon, 9 Dec 2013 16:32:15 +0000 Subject: Reject the packet if data is NULL. svn path=/trunk/; revision=53883 --- epan/dissectors/packet-mpls-y1711.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-mpls-y1711.c b/epan/dissectors/packet-mpls-y1711.c index 73cc880f21..e747ac8a7f 100644 --- a/epan/dissectors/packet-mpls-y1711.c +++ b/epan/dissectors/packet-mpls-y1711.c @@ -116,7 +116,7 @@ static const value_string y1711_defect_type_vals[] = { static int dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - struct mplsinfo *mplsinfo = (struct mplsinfo *)data; + struct mplsinfo *mplsinfo; int offset = 0; proto_item *ti; proto_tree *mpls_y1711_tree; @@ -129,6 +129,11 @@ dissect_mpls_y1711(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + mplsinfo = (struct mplsinfo *)data; + functype = tvb_get_guint8(tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " (Y.1711: %s)", (functype == 0x01) ? "CV" : -- cgit v1.2.1