Another patch for #3389 (Fixes #3397)

This commit is contained in:
Miroslav Stampar
2018-12-10 12:59:13 +01:00
parent f04584bb68
commit 070e173067
3 changed files with 2 additions and 19 deletions

View File

@@ -168,19 +168,8 @@ class Metasploit:
choice = readInput(message, default="%d" % default)
if not choice:
if lst:
choice = getUnicode(default, UNICODE_ENCODING)
else:
return default
elif not choice.isdigit():
logger.warn("invalid value, only digits are allowed")
return self._skeletonSelection(msg, lst, maxValue, default)
elif int(choice) > maxValue or int(choice) < 1:
logger.warn("invalid value, it must be a digit between 1 and %d" % maxValue)
return self._skeletonSelection(msg, lst, maxValue, default)
if not choice or not choice.isdigit() or int(choice) > maxValue or int(choice) < 1:
choice = default
choice = int(choice)