summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-12 19:04:38 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-12 19:04:38 +0000
commit4b609d4c9204dfd2814e5a63dfe79eb00cbf37b3 (patch)
treef821ea40bbaa6752a10ec1d3ac618cc2afd16df2
parenta97a3152b07b213a75e6a458e7762a0bc9284193 (diff)
downloadwireshark-4b609d4c9204dfd2814e5a63dfe79eb00cbf37b3.tar.gz
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
-rw-r--r--asn1/isdn-sup/packet-isdn-sup-template.c33
-rw-r--r--asn1/qsig/packet-qsig-template.c33
-rw-r--r--epan/dissectors/packet-isdn-sup.c39
-rw-r--r--epan/dissectors/packet-mp4ves.c25
-rw-r--r--epan/dissectors/packet-qsig.c37
5 files changed, 110 insertions, 57 deletions
diff --git a/asn1/isdn-sup/packet-isdn-sup-template.c b/asn1/isdn-sup/packet-isdn-sup-template.c
index 94a75fe683..39ac070c52 100644
--- a/asn1/isdn-sup/packet-isdn-sup-template.c
+++ b/asn1/isdn-sup/packet-isdn-sup-template.c
@@ -138,17 +138,20 @@ static const isdn_sup_err_t *get_err(gint32 errcode) {
/*--- dissect_isdn_sup_arg ------------------------------------------------------*/
static int
dissect_isdn_sup_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;
const gchar *p;
const isdn_sup_op_t *op_ptr;
proto_item *ti;
proto_tree *isdn_sup_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 */
@@ -186,17 +189,20 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
/*--- dissect_isdn_sup_res -------------------------------------------------------*/
static int
dissect_isdn_sup_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 = 0;
const gchar *p;
const isdn_sup_op_t *op_ptr;
proto_item *ti;
proto_tree *isdn_sup_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 */
@@ -233,17 +239,20 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
/*--- dissect_isdn_sup_err ------------------------------------------------------*/
static int
dissect_isdn_sup_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 isdn_sup_err_t *err_ptr;
const gchar *p;
proto_item *ti;
proto_tree *isdn_sup_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 */
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 */
diff --git a/epan/dissectors/packet-isdn-sup.c b/epan/dissectors/packet-isdn-sup.c
index c42ee172da..dfb21c3172 100644
--- a/epan/dissectors/packet-isdn-sup.c
+++ b/epan/dissectors/packet-isdn-sup.c
@@ -1,7 +1,7 @@
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-isdn-sup.c */
-/* ../../tools/asn2wrs.py -b -k -p isdn-sup -c ./isdn-sup.cnf -s ./packet-isdn-sup-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Basic-Service-Elements.asn Embedded-Q931-Types.asn General-Errors.asn Advice-of-Charge-Operations.asn Closed-User-Group-Service-Operations.asn Conference-Add-On-Operations.asn Diversion-Operations.asn MCID-Operations.asn User-To-User-Signalling-Operations.asn Freephone-Operations.asn */
+/* ../../tools/asn2wrs.py -b -p isdn-sup -c ./isdn-sup.cnf -s ./packet-isdn-sup-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Basic-Service-Elements.asn Embedded-Q931-Types.asn General-Errors.asn Advice-of-Charge-Operations.asn Closed-User-Group-Service-Operations.asn Conference-Add-On-Operations.asn Diversion-Operations.asn MCID-Operations.asn User-To-User-Signalling-Operations.asn Freephone-Operations.asn */
/* Input file: packet-isdn-sup-template.c */
@@ -2618,17 +2618,20 @@ static const isdn_sup_err_t *get_err(gint32 errcode) {
/*--- dissect_isdn_sup_arg ------------------------------------------------------*/
static int
dissect_isdn_sup_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;
const gchar *p;
const isdn_sup_op_t *op_ptr;
proto_item *ti;
proto_tree *isdn_sup_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 */
@@ -2666,17 +2669,20 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
/*--- dissect_isdn_sup_res -------------------------------------------------------*/
static int
dissect_isdn_sup_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 = 0;
const gchar *p;
const isdn_sup_op_t *op_ptr;
proto_item *ti;
proto_tree *isdn_sup_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 */
@@ -2713,17 +2719,20 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
/*--- dissect_isdn_sup_err ------------------------------------------------------*/
static int
dissect_isdn_sup_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 isdn_sup_err_t *err_ptr;
const gchar *p;
proto_item *ti;
proto_tree *isdn_sup_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 */
@@ -3444,7 +3453,7 @@ void proto_register_isdn_sup(void) {
NULL, HFILL }},
/*--- End of included file: packet-isdn-sup-hfarr.c ---*/
-#line 339 "../../asn1/isdn-sup/packet-isdn-sup-template.c"
+#line 348 "../../asn1/isdn-sup/packet-isdn-sup-template.c"
};
/* List of subtrees */
@@ -3520,7 +3529,7 @@ void proto_register_isdn_sup(void) {
&ett_isdn_sup_Call_T_FPHArg,
/*--- End of included file: packet-isdn-sup-ettarr.c ---*/
-#line 346 "../../asn1/isdn-sup/packet-isdn-sup-template.c"
+#line 355 "../../asn1/isdn-sup/packet-isdn-sup-template.c"
};
/* Register fields and subtrees */
diff --git a/epan/dissectors/packet-mp4ves.c b/epan/dissectors/packet-mp4ves.c
index 7649fee80b..47569edc2a 100644
--- a/epan/dissectors/packet-mp4ves.c
+++ b/epan/dissectors/packet-mp4ves.c
@@ -787,8 +787,12 @@ dissect_mp4ves_par_profile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
int offset = 0;
guint16 lvl;
const gchar *p = NULL;
- asn1_ctx_t *actx = get_asn1_ctx(data);
+ asn1_ctx_t *actx;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ actx = get_asn1_ctx(data);
DISSECTOR_ASSERT(actx);
lvl = tvb_get_ntohs(tvb, offset);
@@ -805,8 +809,12 @@ dissect_mp4ves_par_video_object_type(tvbuff_t *tvb, packet_info *pinfo _U_, prot
int offset = 0;
guint16 lvl;
const gchar *p = NULL;
- asn1_ctx_t *actx = get_asn1_ctx(data);
+ asn1_ctx_t *actx;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ actx = get_asn1_ctx(data);
DISSECTOR_ASSERT(actx);
lvl = tvb_get_ntohs(tvb, offset);
@@ -821,8 +829,12 @@ dissect_mp4ves_par_video_object_type(tvbuff_t *tvb, packet_info *pinfo _U_, prot
static int
dissect_mp4ves_par_decoderConfigurationInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- asn1_ctx_t *actx = get_asn1_ctx(data);
+ asn1_ctx_t *actx;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ actx = get_asn1_ctx(data);
DISSECTOR_ASSERT(actx);
dissect_mp4ves_config(tvb, pinfo, tree);
@@ -859,10 +871,15 @@ static mp4ves_capability_t *find_cap(const gchar *id) {
static int
dissect_mp4ves_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree, void* data)
{
- asn1_ctx_t *actx = get_asn1_ctx(data);
+ asn1_ctx_t *actx;
mp4ves_capability_t *ftr;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ actx = get_asn1_ctx(data);
DISSECTOR_ASSERT(actx);
+
if (tree) {
ftr = find_cap(pinfo->match_string);
if (ftr) {
diff --git a/epan/dissectors/packet-qsig.c b/epan/dissectors/packet-qsig.c
index 5baa7f339c..711793d93c 100644
--- a/epan/dissectors/packet-qsig.c
+++ b/epan/dissectors/packet-qsig.c
@@ -12381,17 +12381,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 */
@@ -12437,17 +12440,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 */
@@ -12488,17 +12494,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 */
@@ -15895,7 +15904,7 @@ void proto_register_qsig(void) {
NULL, HFILL }},
/*--- End of included file: packet-qsig-hfarr.c ---*/
-#line 653 "../../asn1/qsig/packet-qsig-template.c"
+#line 662 "../../asn1/qsig/packet-qsig-template.c"
};
/* List of subtrees */
@@ -16346,7 +16355,7 @@ void proto_register_qsig(void) {
&ett_qsig_mid_SEQUENCE_OF_Extension,
/*--- End of included file: packet-qsig-ettarr.c ---*/
-#line 661 "../../asn1/qsig/packet-qsig-template.c"
+#line 670 "../../asn1/qsig/packet-qsig-template.c"
&ett_cnq_PSS1InformationElement,
};