From c64eb38a8ba69bd2fc01f8749899704ba316c7ca Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 12 May 2011 11:52:18 +0000 Subject: [PATCH] same thing as for the last commit, but for error technique this time --- lib/techniques/error/use.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index ab133a6ef..ef64d9c42 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -289,15 +289,7 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False): _, _, _, _, _, _, countedExpressionFields, _ = agent.getFields(countedExpression) count = __oneShotErrorUse(countedExpression, countedExpressionFields) - if (not count or (count.isdigit() and int(count) == 0)): - warnMsg = "it was not possible to count the number " - warnMsg += "of entries for the used SQL query. " - warnMsg += "sqlmap will assume that it returns only " - warnMsg += "one entry" - logger.warn(warnMsg) - - stopLimit = 1 - elif isNumPosStrValue(count): + if isNumPosStrValue(count): if isinstance(stopLimit, int) and stopLimit > 0: stopLimit = min(int(count), int(stopLimit)) else: @@ -307,6 +299,15 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False): infoMsg += "%d entries" % stopLimit logger.info(infoMsg) + else: + warnMsg = "it was not possible to count the number " + warnMsg += "of entries for the used SQL query. " + warnMsg += "sqlmap will assume that it returns only " + warnMsg += "one entry" + logger.warn(warnMsg) + + stopLimit = 1 + try: if stopLimit > TURN_OFF_RESUME_INFO_LIMIT: kb.suppressResumeInfo = True