BER: Fix extension lengths

Previously the length was ignored and if a Sequence contains more then
one extensions (in the ellipsis) then the value of the second was
wrongly added to the value of the previous one.
This commit is contained in:
Vasil Velichkov 2022-12-06 19:29:58 +02:00 committed by AndersBroman
parent 3a61e3f851
commit a4f56e90a6
1 changed files with 2 additions and 2 deletions

View File

@ -2266,10 +2266,10 @@ ber_sequence_try_again:
if (!seq->func) {
/* it was not, move to the next one and try again */
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
dissect_ber_length(actx->pinfo, tree, tvb, offset, NULL, NULL);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
cause = proto_tree_add_expert_format(
tree, actx->pinfo, &ei_ber_unknown_field_sequence,
tvb, hoffset, -1,
tvb, hoffset, ((offset - hoffset) + len),
"BER Error: This field lies beyond the end of the known sequence definition.");
if (decode_unexpected) {
proto_tree *unknown_tree = proto_item_add_subtree(cause, ett_ber_unknown);