/* ok in here we can traverse the BER to find the length, this will fix most indefinite length issues */
/* Assumption here is that indefinite length is always used on constructed types*/
/* check for EOC */
- while ((tvb_reported_length_remaining(tvb,offset)>0) && ( tvb_get_guint8(tvb, offset) || tvb_get_guint8(tvb,offset+1)))
- {
+ while (tvb_get_guint8(tvb, offset) || tvb_get_guint8(tvb, offset+1)) {
/* not an EOC at offset */
s_offset=offset;
offset= get_ber_identifier(tvb, offset, &tclass, &tpc, &ttag);
/* Make sure we've moved forward in the packet */
if (offset <= s_offset)
THROW(ReportedBoundsError);
- }
+ }
tmp_length += 2;
tmp_ind = TRUE;
offset = tmp_offset;
if (ind)
*ind = tmp_ind;
+#ifdef DEBUG_BER
+printf("get BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_length_remaining(tvb, offset));
+#endif
+
return offset;
}
*length = tmp_length;
if(ind)
*ind = tmp_ind;
+
+#ifdef DEBUG_BER
+printf("dissect BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_length_remaining(tvb, offset));
+#endif
+
return offset;
}
static int