diff --git a/lib/core/settings.py b/lib/core/settings.py index 333c15be7..0dc3bc4c6 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.3.3.73" +VERSION = "1.3.3.74" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/lib/utils/xrange.py b/lib/utils/xrange.py index 3e4ca31ef..086e46c3d 100644 --- a/lib/utils/xrange.py +++ b/lib/utils/xrange.py @@ -12,6 +12,20 @@ class xrange(object): Advanced (re)implementation of xrange (supports slice/copy/etc.) Reference: http://code.activestate.com/recipes/521885-a-pythonic-implementation-of-xrange/ + >>> list(xrange(1, 9)) == range(1, 9) + True + >>> list(xrange(8, 0, -16)) == range(8, 0, -16) + True + >>> list(xrange(0, 8, 16)) == range(0, 8, 16) + True + >>> list(xrange(0, 4, 5)) == range(0, 4, 5) + True + >>> list(xrange(4, 0, 3)) == range(4, 0, 3) + True + >>> list(xrange(0, -3)) == range(0, -3) + True + >>> list(xrange(0, 7, 2)) == range(0, 7, 2) + True >>> foobar = xrange(1, 10) >>> 7 in foobar True @@ -60,7 +74,7 @@ class xrange(object): return self._len() def _len(self): - return max(0, int((self.stop - self.start) // self.step)) + return max(0, 1 + int((self.stop - 1 - self.start) // self.step)) def __contains__(self, value): return (self.start <= value < self.stop) and (value - self.start) % self.step == 0