Change in pysim[master]: commands: return none, when offset exceeds file length

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Nov 3 10:49:49 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/26083 )


Change subject: commands: return none, when offset exceeds file length
......................................................................

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
---
M pySim/commands.py
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/83/26083/1

diff --git a/pySim/commands.py b/pySim/commands.py
index 1fd1f61..347b821 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -140,6 +140,9 @@
 			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:

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I2c017c620254fae188022851ef3b670730aab503
Gerrit-Change-Number: 26083
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211103/d728719b/attachment.htm>


More information about the gerrit-log mailing list