From efe41fbdc791965c2b5ff711382de4a670b9f027 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 20 Nov 2015 11:32:54 +0100 Subject: [PATCH] Fixes #1547 --- lib/techniques/error/use.py | 10 +++++++++- lib/techniques/union/use.py | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index 8a8009d34..e394b5b58 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -37,6 +37,7 @@ from lib.core.dicts import FROM_DUMMY_TABLE from lib.core.enums import DBMS from lib.core.enums import HASHDB_KEYS from lib.core.enums import HTTP_HEADER +from lib.core.exception import SqlmapDataException from lib.core.settings import CHECK_ZERO_COLUMNS_THRESHOLD from lib.core.settings import MIN_ERROR_CHUNK_LENGTH from lib.core.settings import MAX_ERROR_CHUNK_LENGTH @@ -345,7 +346,14 @@ def errorUse(expression, dump=False): numThreads = min(conf.threads, (stopLimit - startLimit)) threadData = getCurrentThreadData() - threadData.shared.limits = iter(xrange(startLimit, stopLimit)) + + try: + threadData.shared.limits = iter(xrange(startLimit, stopLimit)) + except OverflowError: + errMsg = "boundary limits (%d,%d) are too large. Please rerun " % (startLimit, stopLimit) + errMsg += "with switch '--fresh-queries'" + raise SqlmapDataException(errMsg) + threadData.shared.value = BigArray() threadData.shared.buffered = [] threadData.shared.counter = 0 diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 034223c52..cc4a93aaa 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -43,6 +43,7 @@ from lib.core.data import queries from lib.core.dicts import FROM_DUMMY_TABLE from lib.core.enums import DBMS from lib.core.enums import PAYLOAD +from lib.core.exception import SqlmapDataException from lib.core.exception import SqlmapSyntaxException from lib.core.settings import MAX_BUFFERED_PARTIAL_UNION_LENGTH from lib.core.settings import SQL_SCALAR_REGEX @@ -231,7 +232,14 @@ def unionUse(expression, unpack=True, dump=False): return value threadData = getCurrentThreadData() - threadData.shared.limits = iter(xrange(startLimit, stopLimit)) + + try: + threadData.shared.limits = iter(xrange(startLimit, stopLimit)) + except OverflowError: + errMsg = "boundary limits (%d,%d) are too large. Please rerun " % (startLimit, stopLimit) + errMsg += "with switch '--fresh-queries'" + raise SqlmapDataException(errMsg) + numThreads = min(conf.threads, (stopLimit - startLimit)) threadData.shared.value = BigArray() threadData.shared.buffered = []