MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / getLimitRange

Function getLimitRange

lib/core/common.py:1876–1906  ·  view source on GitHub ↗

Returns range of values used in limit/offset constructs >>> [_ for _ in getLimitRange(10)] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

(count, plusOne=False)

Source from the content-addressed store, hash-verified

1874 return expression
1875
1876def getLimitRange(count, plusOne=False):
1877 """
1878 Returns range of values used in limit/offset constructs
1879
1880 >>> [_ for _ in getLimitRange(10)]
1881 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1882 """
1883
1884 retVal = None
1885 count = int(count)
1886 limitStart, limitStop = 1, count
1887 reverse = False
1888
1889 if kb.dumpTable:
1890 if conf.limitStart and conf.limitStop and conf.limitStart > conf.limitStop:
1891 limitStop = conf.limitStart
1892 limitStart = conf.limitStop
1893 reverse = True
1894 else:
1895 if isinstance(conf.limitStop, int) and conf.limitStop > 0 and conf.limitStop < limitStop:
1896 limitStop = conf.limitStop
1897
1898 if isinstance(conf.limitStart, int) and conf.limitStart > 0 and conf.limitStart <= limitStop:
1899 limitStart = conf.limitStart
1900
1901 retVal = xrange(limitStart, limitStop + 1) if plusOne else xrange(limitStart - 1, limitStop)
1902
1903 if reverse:
1904 retVal = xrange(retVal[-1], retVal[0] - 1, -1)
1905
1906 return retVal
1907
1908def parseUnionPage(page):
1909 """

Callers 15

xpCmdshellEvalCmdMethod · 0.90
getDbsMethod · 0.90
getTablesMethod · 0.90
getColumnsMethod · 0.90
getStatementsMethod · 0.90
dumpTableMethod · 0.90
searchDbMethod · 0.90
searchTableMethod · 0.90
searchColumnMethod · 0.90
getUsersMethod · 0.90
getPasswordHashesMethod · 0.90
getPrivilegesMethod · 0.90

Calls 1

xrangeClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…