dexter has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/54/33954/1

diff --git a/pySim/utils.py b/pySim/utils.py
index 735468e..2a4d24a 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -771,6 +771,10 @@
         if tlv[1] == 0:
             continue

+        # Uninitialized field
+        if tlv[2] == [0xff] * len(tlv[2]):
+            continue
+
         # First byte in the value has the address type
         addr_type = tlv[2][0]
         # TODO: Support parsing of IPv6

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/33954
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idc0a92ea88756266381c8da2ad62de061a8ea7a1
Gerrit-Change-Number: 33954
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to