From ddc9a82f64f8729557c75a05891c2195c956e45f Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Wed, 15 May 2019 21:07:43 +0200 Subject: hw/pyprofibus: Fix off-by-one error in input cache allocation Signed-off-by: Michael Buesch --- awlsimhw_pyprofibus/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awlsimhw_pyprofibus/main.py b/awlsimhw_pyprofibus/main.py index ea8de818..05a61030 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)) -- cgit v1.2.3