diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2012-11-16 10:20:36 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2012-11-16 10:20:36 +0000 |
commit | d93bf350b59e4fdce4948393d70028530409f1c7 (patch) | |
tree | 168e7bcc76ee6978dbf76415259e3d1e48547caf /asn1 | |
parent | 57d3c5e26002456c195625e79626a19f89bbb69a (diff) | |
download | wireshark-d93bf350b59e4fdce4948393d70028530409f1c7.tar.gz |
Added a try-catch in the heuristics to avoid a false malformed packet
error when having no data (occurs in COTP CR and CC).
svn path=/trunk/; revision=46038
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/t125/packet-t125-template.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/asn1/t125/packet-t125-template.c b/asn1/t125/packet-t125-template.c index 3ab39a4d9b..f3804cc493 100644 --- a/asn1/t125/packet-t125-template.c +++ b/asn1/t125/packet-t125-template.c @@ -95,14 +95,18 @@ dissect_t125_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree guint32 choice_index = 100; asn1_ctx_t asn1_ctx; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); - - /* could be BER */ - get_ber_identifier(tvb, 0, &ber_class, &pc, &tag); - /* or PER */ - dissect_per_constrained_integer(tvb, 0, &asn1_ctx, - NULL, hf_t125_heur, 0, 42, - &choice_index, FALSE); + TRY { + asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); + + /* could be BER */ + get_ber_identifier(tvb, 0, &ber_class, &pc, &tag); + /* or PER */ + dissect_per_constrained_integer(tvb, 0, &asn1_ctx, + NULL, hf_t125_heur, 0, 42, + &choice_index, FALSE); + } CATCH_ALL { + return FALSE; + } ENDTRY; /* is this strong enough ? */ if ( ((ber_class==BER_CLASS_APP) && ((tag>=101) && (tag<=104))) || |