File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818from thirdparty .six import unichr as _unichr
1919
2020# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21- VERSION = "1.5.1.12 "
21+ VERSION = "1.5.1.13 "
2222TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2323TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2424VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
757757# For preventing MemoryError exceptions (caused when using large sequences in difflib.SequenceMatcher)
758758MAX_DIFFLIB_SEQUENCE_LENGTH = 10 * 1024 * 1024
759759
760+ MAX_CHAR_HEURISTICS_SIZE = 10000
761+
760762# Maximum (multi-threaded) length of entry in bisection algorithm
761763MAX_BISECTION_LENGTH = 50 * 1024 * 1024
762764
Original file line number Diff line number Diff line change 4444from lib .core .settings import DEFAULT_COOKIE_DELIMITER
4545from lib .core .settings import EVENTVALIDATION_REGEX
4646from lib .core .settings import IDENTYWAF_PARSE_LIMIT
47+ from lib .core .settings import MAX_CHAR_HEURISTICS_SIZE
4748from lib .core .settings import MAX_CONNECTION_TOTAL_SIZE
4849from lib .core .settings import META_CHARSET_REGEX
4950from lib .core .settings import PARSE_HEADERS_LIMIT
@@ -258,7 +259,7 @@ def getHeuristicCharEncoding(page):
258259 """
259260
260261 key = hash (page )
261- retVal = kb .cache .encoding .get (key ) or detect (page )["encoding" ]
262+ retVal = kb .cache .encoding .get (key ) or detect (page [: MAX_CHAR_HEURISTICS_SIZE ] )["encoding" ]
262263 kb .cache .encoding [key ] = retVal
263264
264265 if retVal and retVal .lower ().replace ('-' , "" ) == UNICODE_ENCODING .lower ().replace ('-' , "" ):
You can’t perform that action at this time.
0 commit comments