summaryrefslogtreecommitdiff
path: root/asn1/h460
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-12 18:10:08 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-12 18:10:08 +0000
commita97a3152b07b213a75e6a458e7762a0bc9284193 (patch)
treed52982e4d9e4275adb1004a62f3ad71e0af6e1f3 /asn1/h460
parent74b58162d70994797401b791c0e833ac000110f2 (diff)
downloadwireshark-a97a3152b07b213a75e6a458e7762a0bc9284193.tar.gz
Reject the packet if data is NULL. Remove _U_ where data is actually used. For now, leave the DISSECTOR_ASSERT's since both get_rose_ctx() and get_asn1_ctx() also check signatures.
(Arguably it's the responsibility of the dissector passing this information to set the signature correctly so if there's an invalid signature, the bug is with the calling dissector and not with the one receiving the invalid signature.) svn path=/trunk/; revision=53964
Diffstat (limited to 'asn1/h460')
-rw-r--r--asn1/h460/packet-h460-template.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/asn1/h460/packet-h460-template.c b/asn1/h460/packet-h460-template.c
index 03385dd10a..bf9e8f0a87 100644
--- a/asn1/h460/packet-h460-template.c
+++ b/asn1/h460/packet-h460-template.c
@@ -52,8 +52,8 @@ static int proto_h460 = -1;
#include "packet-h460-ett.c"
/* Subdissectors */
-static dissector_handle_t q931_ie_handle = NULL;
-static dissector_handle_t h225_ras_handle = NULL;
+static dissector_handle_t q931_ie_handle = NULL;
+static dissector_handle_t h225_ras_handle = NULL;
#include "packet-h460-fn.c"
@@ -68,7 +68,7 @@ dissect_ies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
return offset;
}
-static int
+static int
dissect_ras(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
int offset = 0;
@@ -202,7 +202,7 @@ static h460_feature_t h460_feature_tab[] = {
{ GD|FD, "22/2", "ipsecSecurityProtocol", NULL, FFILL },
{ GD|FD, "22/2/1", "priority", NULL, FFILL },
{ 0, NULL, NULL, NULL, FFILL },
-};
+};
static h460_feature_t *find_ftr(const gchar *key) {
h460_feature_t *ftr = NULL;
@@ -221,10 +221,15 @@ static h460_feature_t *find_ftr(const gchar *key) {
static int
dissect_h460_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree, void *data) {
int offset = 0;
- asn1_ctx_t *actx = get_asn1_ctx(data);
+ asn1_ctx_t *actx;
h460_feature_t *ftr;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ actx = get_asn1_ctx(data);
DISSECTOR_ASSERT(actx);
+
if (tree) {
/* DEBUG */ /*proto_tree_add_text(tree, tvb, 0, 0, "*** DEBUG dissect_h460_name: %s", pinfo->match_string);*/
ftr = find_ftr(pinfo->match_string);
@@ -271,7 +276,7 @@ void proto_register_h460(void) {
}
/*--- proto_reg_handoff_h460 -------------------------------------------*/
-void proto_reg_handoff_h460(void)
+void proto_reg_handoff_h460(void)
{
h460_feature_t *ftr;
dissector_handle_t h460_name_handle;