aboutsummaryrefslogtreecommitdiffstats
path: root/pySim/commands.py
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-11-03 11:46:05 +0100
committerdexter <pmaier@sysmocom.de>2021-11-05 16:55:48 +0000
commite087f909b3fcb5824556e52fe7d42cee0a647c89 (patch)
treed3be8b2b7148732b807d6c7e7e2cc124b81c51c2 /pySim/commands.py
parent712251a6e0ce5649b1891def13d36b7dd029663b (diff)
commands: return none, when offset exceeds file length
The computed length of the file may be negative, when the offset exceeds the file length. When this is the case, return none Change-Id: I2c017c620254fae188022851ef3b670730aab503
Diffstat (limited to 'pySim/commands.py')
-rw-r--r--pySim/commands.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pySim/commands.py b/pySim/commands.py
index 107f0f5..cea330e 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -155,6 +155,9 @@ class SimCardCommands(object):
return (None, None)
if length is None:
length = self.__len(r) - offset
+ if length < 0:
+ return (None, None)
+
total_data = ''
chunk_offset = 0
while chunk_offset < length: