From 941daa1645ffc134ba8d7466f0ac50caa2d5c9d3 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 11 Apr 2011 11:59:02 +0000 Subject: [PATCH] just in case to prevent "object of type 'NoneType' has no len()" error reports --- lib/core/settings.py | 3 +++ plugins/generic/enumeration.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index a0d36c067..7d4018346 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -298,3 +298,6 @@ DEFAULT_MSSQL_SCHEMA = 'dbo' # display hash attack info every mod number of items HASH_MOD_ITEM_DISPLAY = 1117 + +# maximum integer value +MAX_INT = sys.maxint diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index a0feb81cd..e7de91d7e 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -55,6 +55,7 @@ from lib.core.session import setOs from lib.core.settings import CONCAT_ROW_DELIMITER from lib.core.settings import CONCAT_VALUE_DELIMITER from lib.core.settings import DEFAULT_MSSQL_SCHEMA +from lib.core.settings import MAX_INT from lib.core.settings import SQL_STATEMENTS from lib.core.shell import autoCompletion from lib.core.unescaper import unescaper @@ -1137,7 +1138,7 @@ class Enumeration: else: count = inject.getValue(query, blind=False) - colList = sorted(colList, key=lambda x: len(x)) + colList = sorted(colList, key=lambda x: len(x) if x else MAX_INT) for column in colList: infoMsg = "fetching number of distinct "