From a4f21399e74c35989a2901a8f0124e34b2ef272b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 17 Mar 2016 16:23:28 +0100 Subject: [PATCH] Fixes #1760 --- lib/core/common.py | 18 +++++++++++++++++- lib/core/settings.py | 5 ++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index be66260b8..f90a94ed7 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -128,6 +128,7 @@ from lib.core.settings import PARTIAL_VALUE_MARKER from lib.core.settings import PAYLOAD_DELIMITER from lib.core.settings import PLATFORM from lib.core.settings import PRINTABLE_CHAR_REGEX +from lib.core.settings import PUSH_VALUE_EXCEPTION_RETRY_COUNT from lib.core.settings import PYVERSION from lib.core.settings import REFERER_ALIASES from lib.core.settings import REFLECTED_BORDER_REGEX @@ -2183,7 +2184,22 @@ def pushValue(value): Push value to the stack (thread dependent) """ - getCurrentThreadData().valueStack.append(copy.deepcopy(value)) + _ = None + success = False + + for i in xrange(PUSH_VALUE_EXCEPTION_RETRY_COUNT): + try: + getCurrentThreadData().valueStack.append(copy.deepcopy(value)) + success = True + break + except Exception, ex: + _ = ex + + if not success: + getCurrentThreadData().valueStack.append(None) + + if _: + raise _ def popValue(): """ diff --git a/lib/core/settings.py b/lib/core/settings.py index 69ca14601..30f158e60 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version and site -VERSION = "1.0.0.21" +VERSION = "1.0.0.22" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") @@ -139,6 +139,9 @@ MAX_BUFFERED_PARTIAL_UNION_LENGTH = 1024 # Suffix used for naming meta databases in DBMS(es) without explicit database name METADB_SUFFIX = "_masterdb" +# Number of times to retry the pushValue during the exceptions (e.g. KeyboardInterrupt) +PUSH_VALUE_EXCEPTION_RETRY_COUNT = 3 + # Minimum time response set needed for time-comparison based on standard deviation MIN_TIME_RESPONSES = 30