Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
diff options
context:
space:
mode:
authorInsanemal <insanemal@gmail.com>2021-04-09 13:44:51 +1000
committerGitHub <noreply@github.com>2021-04-09 13:44:51 +1000
commitacc2dac6527b5f7553a7066f80cc0680d328d31e (patch)
tree49b44bdbf6d2e857aa1622e827e805b240a6a6d5 /archinstall/lib/user_interaction.py
parent303dbd567ac2dd7507cbec2e9b5e39775fc04f2e (diff)
Off by one in generic_selection out of bounds check
Out of bounds check in generic_selection is using >= on list. Lists are zero based. If you put in a value that equals the number of items in the list you get an out of bounds error. Removed the equals part of the test as last item in list/dictionary items is len(list)-1 not len(list)
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 3830962c..f8585595 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -184,7 +184,7 @@ def generic_select(options, input_text="Select one of the above by index or abso
return None
elif selected_option.isdigit():
selected_option = int(selected_option)
- if selected_option >= len(options):
+ if selected_option > len(options):
raise RequirementError(f'Selected option "{selected_option}" is out of range')
selected_option = options[selected_option]
elif selected_option in options: