aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-07-17 10:22:59 +0000
committerGuy Harris <guy@alum.mit.edu>2004-07-17 10:22:59 +0000
commit8669624f24f0cca9b6a0116d60e59e0327939be1 (patch)
tree25b7b3ac62ee65c10d78a1ac7665e71898cffee6
parent456b2c075fea7a98d4f4abade87c7d358792edad (diff)
From Yuriy Sidelnikov: if asn1_length_decode() returns 0 but
tvb_reported_length_remaining() returns more then two bytes we still have to dissect rest of the pdu. svn path=/trunk/; revision=11391
-rw-r--r--packet-pres.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/packet-pres.c b/packet-pres.c
index 389b4d799f..af0b8330e4 100644
--- a/packet-pres.c
+++ b/packet-pres.c
@@ -729,6 +729,10 @@ new_item_len )
asn->offset = (*offset);
return ;
}
+ if(!new_item_len && length>2)
+ {
+ new_item_len = length-1; /* can't get length from asn1 tag. Use rest of the pdu len. */
+ }
header_len = asn->offset - (*offset) +1;
ms = proto_tree_add_text(pres_tree, tvb, *offset-1,
new_item_len+(asn->offset-*offset)+1,
@@ -845,6 +849,11 @@ new_item_len )
asn->offset = (*offset);
return ;
}
+ if(!new_item_len && length>2)
+ {
+ /* check if really do have what to dissect */
+ new_item_len = length-1;
+ }
ms = proto_tree_add_text(pres_tree_pc, tvb, *offset-1,
new_item_len+(asn->offset-*offset)+1,
val_to_str(type, presentation_context_definition_vals,
@@ -1557,6 +1566,22 @@ dissect_ppdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
{
return FALSE;
}
+ if(!rest_len)
+ {
+ guint rest_pdu_len = 0;
+ /* do we really haven't any more bytes ? */
+ if( (rest_pdu_len = tvb_reported_length_remaining(tvb, offset)) )
+ {
+ /*
+ * we have but can't say how many from asn1 information.
+ * use pdu len instead
+ */
+ if(rest_pdu_len > 2)
+ {
+ rest_len = rest_pdu_len;
+ }
+ }
+ }
ms = proto_tree_add_text(pres_tree, tvb, offset, rest_len,
val_to_str(session->spdu_type, ses_vals, "Unknown Ppdu type (0x%02x)"));
pres_tree_ms = proto_item_add_subtree(ms, ett_pres_ms);