[master 1/1] Fix IndexError: list index out of range (#1219004)

jkonecny12 installerbot-noreply at redhat.com
Tue May 12 13:57:23 UTC 2015


From: Jiri Konecny <jkonecny at redhat.com>

Add user input boundary test to text ui Timezone settings.
---
 pyanaconda/ui/tui/spokes/time_spoke.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pyanaconda/ui/tui/spokes/time_spoke.py b/pyanaconda/ui/tui/spokes/time_spoke.py
index 653df0f..bcb707e 100644
--- a/pyanaconda/ui/tui/spokes/time_spoke.py
+++ b/pyanaconda/ui/tui/spokes/time_spoke.py
@@ -119,6 +119,8 @@ def input(self, args, key):
             self._selection = "%s/%s" % (args, self._timezones[args][keyid])
             self.apply()
             self.close()
+        elif keyid >= len(self._regions) or keyid < 0:
+            return key
         else:
             if len(self._timezones[self._regions[keyid]]) == 1:
                 self._selection = "%s/%s" % (self._regions[keyid],


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/8371074f2afb9215b461b2d5bc929958631f1389


More information about the anaconda-patches mailing list