aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-10-17 16:12:24 +0000
committerGerald Combs <gerald@wireshark.org>2005-10-17 16:12:24 +0000
commit5cadbb4de46ba08c2871fbdb881f12d949109ea5 (patch)
treea838583c9e0b7153f22387a44331214c048fc759 /asn1
parente3285cbcaeb9a72ac331b507cc0ed2c8a5a83fa3 (diff)
When dissecting an ACSE APDU make sure our OID isn't for an ACSE APDU
(which would make us recurse until we crashed). svn path=/trunk/; revision=16252
Diffstat (limited to 'asn1')
-rw-r--r--asn1/acse/packet-acse-template.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/asn1/acse/packet-acse-template.c b/asn1/acse/packet-acse-template.c
index 14ba0cd428..7fa57124cf 100644
--- a/asn1/acse/packet-acse-template.c
+++ b/asn1/acse/packet-acse-template.c
@@ -2,7 +2,7 @@
There is a bug in asn2eth that it can not yet handle tagged assignments such
as EXTERNAL ::= [UNIVERSAL 8] IMPLICIT SEQUENCE {
- This bug is workedaround by some .cnf magic but this should be cleaned up
+ This bug is workedaround by some .cnf magic but this should be cleaned up
once asn2eth learns how to deal with tagged assignments
*/
@@ -11,7 +11,7 @@
* Ronnie Sahlberg 2005
* dissect_acse() based original handwritten dissector by Sid
* Yuriy Sidelnikov <YSidelnikov@hotmail.com>
- *
+ *
*
* $Id$
*
@@ -56,6 +56,8 @@
#define PSNAME "ACSE"
#define PFNAME "acse"
+#define ACSE_APDU_OID "2.2.1.0.1"
+
/* Initialize the protocol and registered fields */
int proto_acse = -1;
#include "packet-acse-hf.c"
@@ -158,7 +160,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* first, try to check length */
/* do we have at least 2 bytes */
if (!tvb_bytes_exist(tvb, 0, 2)){
- proto_tree_add_text(parent_tree, tvb, offset,
+ proto_tree_add_text(parent_tree, tvb, offset,
tvb_reported_length_remaining(tvb,offset),
"User data");
return; /* no, it isn't a ACSE PDU */
@@ -167,7 +169,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
if( !pinfo->private_data ){
if(parent_tree){
REPORT_DISSECTOR_BUG("Can't get SPDU type from session dissector.");
- }
+ }
return ;
} else {
session = ( (struct SESSION_DATA_STRUCTURE*)(pinfo->private_data) );
@@ -192,7 +194,11 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
break;
case SES_DATA_TRANSFER:
oid=find_oid_by_pres_ctx_id(pinfo, indir_ref);
- if(oid){
+ if(strcmp(oid, ACSE_APDU_OID) == 0){
+ proto_tree_add_text(parent_tree, tvb, offset, -1,
+ "Invalid OID: %s", ACSE_APDU_OID);
+ THROW(ReportedBoundsError);
+ } else if(oid){
call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree);
} else {
proto_tree_add_text(parent_tree, tvb, offset, -1,
@@ -258,7 +264,7 @@ void proto_reg_handoff_acse(void) {
/*#include "packet-acse-dis-tab.c"*/
register_ber_oid_name("2.2.3.1.1","aCSE-id");
- register_ber_oid_dissector("2.2.1.0.1", dissect_acse, proto_acse, "acse-as-id");
+ register_ber_oid_dissector(ACSE_APDU_OID, dissect_acse, proto_acse, "acse-as-id");
}