diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-12 19:04:38 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-12 19:04:38 +0000 |
commit | 4b609d4c9204dfd2814e5a63dfe79eb00cbf37b3 (patch) | |
tree | f821ea40bbaa6752a10ec1d3ac618cc2afd16df2 /asn1/qsig/packet-qsig-template.c | |
parent | a97a3152b07b213a75e6a458e7762a0bc9284193 (diff) |
Reject the packet if data is NULL. For now, leave the DISSECTOR_ASSERT's since both get_rose_ctx() and get_asn1_ctx() also check signatures.
svn path=/trunk/; revision=53965
Diffstat (limited to 'asn1/qsig/packet-qsig-template.c')
-rw-r--r-- | asn1/qsig/packet-qsig-template.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/asn1/qsig/packet-qsig-template.c b/asn1/qsig/packet-qsig-template.c index 67069b29a7..bcd708734e 100644 --- a/asn1/qsig/packet-qsig-template.c +++ b/asn1/qsig/packet-qsig-template.c @@ -373,17 +373,20 @@ static const qsig_err_t *get_err(gint32 errcode) { /*--- dissect_qsig_arg ------------------------------------------------------*/ static int dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - int offset; - rose_ctx_t *rctx = get_rose_ctx(data); + int offset = 0; + rose_ctx_t *rctx; gint32 opcode = 0, service; const qsig_op_t *op_ptr; const gchar *p; proto_item *ti, *ti_tmp; proto_tree *qsig_tree; - offset = 0; - + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + rctx = get_rose_ctx(data); DISSECTOR_ASSERT(rctx); + if (rctx->d.pdu != 1) /* invoke */ return offset; if (rctx->d.code == 0) { /* local */ @@ -429,17 +432,20 @@ dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /*--- dissect_qsig_res -------------------------------------------------------*/ static int dissect_qsig_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - gint offset; - rose_ctx_t *rctx = get_rose_ctx(data); + gint offset = 0; + rose_ctx_t *rctx; gint32 opcode, service; const qsig_op_t *op_ptr; const gchar *p; proto_item *ti, *ti_tmp; proto_tree *qsig_tree; - offset = 0; - + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + rctx = get_rose_ctx(data); DISSECTOR_ASSERT(rctx); + if (rctx->d.pdu != 2) /* returnResult */ return offset; if (rctx->d.code != 0) /* local */ @@ -480,17 +486,20 @@ dissect_qsig_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /*--- dissect_qsig_err ------------------------------------------------------*/ static int dissect_qsig_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - int offset; - rose_ctx_t *rctx = get_rose_ctx(data); + int offset = 0; + rose_ctx_t *rctx; gint32 errcode; const qsig_err_t *err_ptr; const gchar *p; proto_item *ti; proto_tree *qsig_tree; - offset = 0; - + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; + rctx = get_rose_ctx(data); DISSECTOR_ASSERT(rctx); + if (rctx->d.pdu != 3) /* returnError */ return offset; if (rctx->d.code != 0) /* local */ |