mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 04:53:48 +03:00
more quick fixes
This commit is contained in:
parent
af701cdaa2
commit
789dd6c66f
|
@ -1027,7 +1027,10 @@ def safeStringFormat(formatStr, params):
|
|||
return retVal
|
||||
|
||||
def sanitizeAsciiString(subject):
|
||||
return "".join(char if ord(char) < 128 else '?' for char in subject)
|
||||
retVal = None
|
||||
if subject:
|
||||
retVal = "".join(char if ord(char) < 128 else '?' for char in subject)
|
||||
return retVal
|
||||
|
||||
def decloakToNamedTemporaryFile(filepath, name=None):
|
||||
retVal = NamedTemporaryFile()
|
||||
|
|
|
@ -203,10 +203,11 @@ class Connect:
|
|||
page = e.read()
|
||||
responseHeaders = e.info()
|
||||
except socket.timeout:
|
||||
page, responseHeaders = None, None
|
||||
warnMsg = "connection timed out while trying "
|
||||
warnMsg += "to get error page information"
|
||||
logger.warn(warnMsg)
|
||||
page, responseHeaders = None, None
|
||||
return None, None
|
||||
code = e.code
|
||||
status = e.msg
|
||||
|
||||
|
@ -249,15 +250,15 @@ class Connect:
|
|||
socket.setdefaulttimeout(conf.timeout)
|
||||
|
||||
page = sanitizeAsciiString(page)
|
||||
|
||||
parseResponse(page, responseHeaders)
|
||||
|
||||
responseMsg += "(%s - %d):\n" % (status, code)
|
||||
|
||||
|
||||
if conf.verbose <= 4:
|
||||
responseMsg += str(responseHeaders)
|
||||
elif conf.verbose > 4:
|
||||
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
||||
|
||||
|
||||
logger.log(8, responseMsg)
|
||||
|
||||
return page, responseHeaders
|
||||
|
|
Loading…
Reference in New Issue
Block a user