Skip to content

Commit

Permalink
fix bug: uninitialize variables in pcs-console
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyc0 committed Mar 15, 2016
1 parent cca4a6d commit dec567a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 5 additions & 2 deletions pocsuite/lib/controller/setpoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ def loadPoc(pocFile):
if conf.isPocString:
poc = conf.pocFile
if not conf.pocname:
errMsg = "Use pocString must provide pocname"
logger.log(CUSTOM_LOGGING.ERROR, errMsg)
if conf.pocFile:
conf.pocname = os.path.split(conf.pocFile)[1]
else:
errMsg = "Use pocString must provide pocname"
logger.log(CUSTOM_LOGGING.ERROR, errMsg)
pocname = conf.pocname
else:
pocname = os.path.split(pocFile)[1]
Expand Down
16 changes: 13 additions & 3 deletions pocsuite/lib/core/consoles.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ def __init__(self):
coloramainit()
Cmd.__init__(self)
os.system("clear")

conf.report = False
conf.retry = False
conf.delay = 0
conf.quiet = False
banner()
self.case_insensitive = False
self.prompt = "Pcs> "
conf.isPocString = False
conf.isPycFile = False
conf.requires = False
conf.requiresFreeze = False

conf.url = None
conf.proxy = None
Expand All @@ -96,6 +101,10 @@ def __init__(self):
conf.timeout = 5
conf.httpHeaders = HTTP_DEFAULT_HEADER

self.prompt = "Pcs> "
banner()
self.case_insensitive = False

def do_verify(self, args):
conf.mode = 'verify'
self._execute()
Expand Down Expand Up @@ -298,6 +307,7 @@ def do_load(self, args):
else:
conf.pocFile = args

conf.pocname = os.path.split(conf.pocFile)[1]
setPoc()

print '[*] load poc file(s) success!'
Expand Down
4 changes: 3 additions & 1 deletion pocsuite/lib/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
'proxy': None,
'proxyCred': None,
'timeout': 5,
'quiet': False
'quiet': False,
'requires': False,
'requiresFreeze': False
}

REPORT_TABLEBASE = """\
Expand Down

0 comments on commit dec567a

Please sign in to comment.