diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-07-23 23:06:38 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-07-23 23:06:38 +0000 |
commit | 52d5646696488f30595239afc113e0023e534392 (patch) | |
tree | ca603cff4fdfc40e256bf9d26f863536132fedbd /epan | |
parent | bbbe995ddbb3a28f0e802e0d9e3e07414193d55f (diff) |
inside dissect_ber_sequence() we know the expected length of the field that follows.
use this and create a new tvbsubset so that
1, reading too much data is flagged as MALFORMED PACKET indicating a bug in the dissector (or a packet that IS malformed)
2, this also implicitely passes the length of the data through the ber.oid dissector handle in case we want to pick it up later.
svn path=/trunk/; revision=11490
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ber.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index 882dadfc3d..ca18f6cdaa 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -431,6 +431,7 @@ int dissect_ber_sequence(gboolean implicit_tag, packet_info *pinfo, proto_tree * proto_tree *tree = parent_tree; proto_item *item = NULL; int end_offset; + tvbuff_t *next_tvb; /* first we must read the sequence header */ offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); @@ -503,7 +504,8 @@ ber_sequence_try_again: } /* call the dissector for this field */ - seq->func(pinfo, tree, tvb, hoffset); + next_tvb = tvb_new_subset(tvb, hoffset, eoffset-hoffset, eoffset-hoffset); + seq->func(pinfo, tree, next_tvb, 0); seq++; offset = eoffset; |