From 22bfedf8bbea3a9aa25d64928c05129292893f23 Mon Sep 17 00:00:00 2001 From: Mark Mossberg Date: Wed, 7 Jun 2017 17:22:37 -0400 Subject: [PATCH] Fix signal_transmit crash (#286) * Check if fd is in self.rwait * Check if set is empty --- manticore/platforms/linux.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manticore/platforms/linux.py b/manticore/platforms/linux.py index dd3aaaa..c0f4223 100644 --- a/manticore/platforms/linux.py +++ b/manticore/platforms/linux.py @@ -1590,9 +1590,13 @@ class Linux(Platform): def signal_transmit(self, fd): ''' Awake one process waiting to transmit data on fd ''' - connections = self.connections - if connections(fd) and self.rwait[connections(fd)]: - procid = random.sample(self.rwait[connections(fd)], 1)[0] + connection = self.connections(fd) + if connection is None or connection >= len(self.rwait): + return + + procs = self.rwait[connection] + if procs: + procid = random.sample(procs, 1)[0] self.awake(procid) def check_timers(self):