proper way of handling 0 length results (as in __goInferenceProxy)

This commit is contained in:
Miroslav Stampar 2011-08-02 08:39:32 +00:00
parent 0643ced651
commit cb0981d858
2 changed files with 18 additions and 4 deletions

View File

@ -310,15 +310,22 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
infoMsg += "%d entries" % stopLimit
logger.info(infoMsg)
else:
elif count and not count.isdigit():
warnMsg = "it was not possible to count the number "
warnMsg += "of entries for the used SQL query. "
warnMsg += "of entries for the SQL query provided. "
warnMsg += "sqlmap will assume that it returns only "
warnMsg += "one entry"
logger.warn(warnMsg)
stopLimit = 1
elif (not count or int(count) == 0):
warnMsg = "the SQL query provided does not "
warnMsg += "return any output"
logger.warn(warnMsg)
return outputs
threadData = getCurrentThreadData()
threadData.shared.limits = iter(xrange(startLimit, stopLimit))
numThreads = min(conf.threads, (stopLimit - startLimit))

View File

@ -251,15 +251,22 @@ def unionUse(expression, unpack=True, dump=False):
infoMsg += "%d entries" % stopLimit
logger.info(infoMsg)
else:
elif count and not count.isdigit():
warnMsg = "it was not possible to count the number "
warnMsg += "of entries for the used SQL query. "
warnMsg += "of entries for the SQL query provided. "
warnMsg += "sqlmap will assume that it returns only "
warnMsg += "one entry"
logger.warn(warnMsg)
stopLimit = 1
elif (not count or int(count) == 0):
warnMsg = "the SQL query provided does not "
warnMsg += "return any output"
logger.warn(warnMsg)
return outputs
threadData = getCurrentThreadData()
threadData.shared.limits = iter(xrange(startLimit, stopLimit))
numThreads = min(conf.threads, (stopLimit - startLimit))