Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a36f7f

Browse files
committed
fix for a bug reported by [email protected] (UnboundLocalError: local variable 'infoMsg' referenced before assignment)
1 parent 9e453e8 commit 8a36f7f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugins/generic/enumeration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,8 @@ def getDbs(self):
702702
if len(kb.data.cachedDbs) > 0:
703703
return kb.data.cachedDbs
704704

705+
infoMsg = None
706+
705707
if Backend.isDbms(DBMS.MYSQL) and not kb.data.has_information_schema:
706708
warnMsg = "information_schema not available, "
707709
warnMsg += "back-end DBMS is MySQL < 5. database "
@@ -725,7 +727,8 @@ def getDbs(self):
725727
else:
726728
infoMsg = "fetching database names"
727729

728-
logger.info(infoMsg)
730+
if infoMsg:
731+
logger.info(infoMsg)
729732

730733
rootQuery = queries[Backend.getIdentifiedDbms()].dbs
731734

0 commit comments

Comments
 (0)