aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2019-05-15 21:07:43 +0200
committerMichael Buesch <m@bues.ch>2019-05-15 21:07:43 +0200
commitddc9a82f64f8729557c75a05891c2195c956e45f (patch)
treebe088f587477311c1aac264d0223a795fb7ce627
parent3df61bd6b92bba6f8768f1a3825c004b4999d3c3 (diff)
downloadawlsim-ddc9a82f64f8729557c75a05891c2195c956e45f.zip
awlsim-ddc9a82f64f8729557c75a05891c2195c956e45f.tar.xz
hw/pyprofibus: Fix off-by-one error in input cache allocation
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--awlsimhw_pyprofibus/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/awlsimhw_pyprofibus/main.py b/awlsimhw_pyprofibus/main.py
index ea8de81..05a6103 100644
--- a/awlsimhw_pyprofibus/main.py
+++ b/awlsimhw_pyprofibus/main.py
@@ -84,7 +84,7 @@ class HardwareInterface_PyProfibus(AbstractHardwareInterface): #+cdef
self.master.destroy()
self.master = None
self.phy = None
- self.cachedInputs = [None] * 0x7F
+ self.cachedInputs = [None] * (0x7F + 1)
def doStartup(self):
# Import the PROFIBUS hardware access modules
@@ -128,7 +128,7 @@ class HardwareInterface_PyProfibus(AbstractHardwareInterface): #+cdef
self.master.initialize()
self.slaveList = self.master.getSlaveList()
- self.cachedInputs = [None] * 0x7F
+ self.cachedInputs = [None] * (0x7F + 1)
except self.pyprofibus.PhyError as e:
self.raiseException("Profibus-PHY error: %s" % str(e))
bues.ch cgit interface