laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/33954 )
Change subject: utils: tolerate uninitialized fields in dec_addr_tlv ......................................................................
utils: tolerate uninitialized fields in dec_addr_tlv
TLV fields holding an address may still be uninitialized and hence filled with 0xff bytes. Lets interpret those fields in the same way as we interpret empty fields.
Related: OS#6094 Change-Id: Idc0a92ea88756266381c8da2ad62de061a8ea7a1 --- M pySim/utils.py 1 file changed, 18 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/pySim/utils.py b/pySim/utils.py index 735468e..1541e2e 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -771,6 +771,10 @@ if tlv[1] == 0: continue
+ # Uninitialized field + if all([v == 0xff for v in tlv[2]]): + continue + # First byte in the value has the address type addr_type = tlv[2][0] # TODO: Support parsing of IPv6