From 10dd9096f74f3b50d5b7675b51047bfbe049fe41 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 29 Feb 2012 14:05:53 +0000 Subject: [PATCH] one more just in case fix for safeSQLIdentificator naming on MSSQL --tables --- plugins/dbms/mssqlserver/enumeration.py | 4 +++- plugins/generic/enumeration.py | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/dbms/mssqlserver/enumeration.py b/plugins/dbms/mssqlserver/enumeration.py index d0653cbee..31f8f69aa 100644 --- a/plugins/dbms/mssqlserver/enumeration.py +++ b/plugins/dbms/mssqlserver/enumeration.py @@ -102,7 +102,9 @@ class Enumeration(GenericEnumeration): break if not isNoneValue(value): - kb.data.cachedTables[db] = arrayizeValue(value) + value = filter(None, arrayizeValue(value)) + value = [safeSQLIdentificatorNaming(_, True) for _ in value] + kb.data.cachedTables[db] = value if not kb.data.cachedTables and isInferenceAvailable() and not conf.direct: for db in dbs: diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index bdcd32d55..6be2697a2 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -927,9 +927,10 @@ class Enumeration: query = rootQuery.blind.query % (unsafeSQLIdentificatorNaming(db), index) table = inject.getValue(query, inband=False, error=False) - kb.hintValue = table - table = safeSQLIdentificatorNaming(table, True) - tables.append(table) + if not isNoneValue(table): + kb.hintValue = table + table = safeSQLIdentificatorNaming(table, True) + tables.append(table) if tables: kb.data.cachedTables[db] = tables