mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-09 08:00:36 +03:00
fixed threading bug (difflib :)
This commit is contained in:
parent
6712b19df2
commit
91dd609e26
|
@ -957,6 +957,7 @@ def __setConfAttributes():
|
||||||
conf.scheme = None
|
conf.scheme = None
|
||||||
#conf.seqMatcher = difflib.SequenceMatcher(lambda x: x in " \t")
|
#conf.seqMatcher = difflib.SequenceMatcher(lambda x: x in " \t")
|
||||||
conf.seqMatcher = difflib.SequenceMatcher(None)
|
conf.seqMatcher = difflib.SequenceMatcher(None)
|
||||||
|
conf.seqLock = None
|
||||||
conf.sessionFP = None
|
conf.sessionFP = None
|
||||||
conf.start = True
|
conf.start = True
|
||||||
conf.threadException = False
|
conf.threadException = False
|
||||||
|
|
|
@ -65,9 +65,15 @@ def comparison(page, headers=None, getSeqMatcher=False):
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if conf.seqLock:
|
||||||
|
conf.seqLock.acquire()
|
||||||
|
|
||||||
conf.seqMatcher.set_seq2(page)
|
conf.seqMatcher.set_seq2(page)
|
||||||
ratio = round(conf.seqMatcher.ratio(), 3)
|
ratio = round(conf.seqMatcher.ratio(), 3)
|
||||||
|
|
||||||
|
if conf.seqLock:
|
||||||
|
conf.seqLock.release()
|
||||||
|
|
||||||
# If the url is stable and we did not set yet the match ratio and the
|
# If the url is stable and we did not set yet the match ratio and the
|
||||||
# current injected value changes the url page content
|
# current injected value changes the url page content
|
||||||
if conf.matchRatio is None:
|
if conf.matchRatio is None:
|
||||||
|
|
|
@ -153,6 +153,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
index = [ firstChar ] # As list for python nested function scoping
|
index = [ firstChar ] # As list for python nested function scoping
|
||||||
idxlock = threading.Lock()
|
idxlock = threading.Lock()
|
||||||
iolock = threading.Lock()
|
iolock = threading.Lock()
|
||||||
|
conf.seqLock = threading.Lock()
|
||||||
|
|
||||||
def downloadThread():
|
def downloadThread():
|
||||||
try:
|
try:
|
||||||
|
@ -237,6 +238,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
if conf.verbose >= 1 and not showEta and infoMsg:
|
if conf.verbose >= 1 and not showEta and infoMsg:
|
||||||
dataToStdout(infoMsg)
|
dataToStdout(infoMsg)
|
||||||
|
|
||||||
|
conf.seqLock = None
|
||||||
else:
|
else:
|
||||||
index = firstChar
|
index = firstChar
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user