PER: Check length calling tvb_new_octet_aligned()

Fix calling tvb_new_octet_aligned() with length == 0

Related to #17890 case 1 and 6
This commit is contained in:
Uli Heilmeier 2022-02-04 21:00:17 +01:00
parent 1f22c7e04c
commit 64f98ee13c
1 changed files with 4 additions and 0 deletions

View File

@ -1138,6 +1138,10 @@ dissect_per_integer(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree
length=4;
}
if(length == 0){
dissect_per_not_decoded_yet(tree, actx->pinfo, tvb, "unexpected length");
}
if (actx->aligned) BYTE_ALIGN_OFFSET(offset);
val_tvb = tvb_new_octet_aligned(tvb, offset, length * 8);
val=0;