Skip to content

Commit 52f2faf

Browse files
committed
Fixes #5059
1 parent d5fb92e commit 52f2faf

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty.six import unichr as _unichr
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.6.4.2"
23+
VERSION = "1.6.4.3"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/threads.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ def setDaemon(thread):
119119
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True):
120120
threads = []
121121

122+
def _threadFunction():
123+
try:
124+
threadFunction()
125+
finally:
126+
if conf.hashDB:
127+
conf.hashDB.close()
128+
122129
kb.multipleCtrlC = False
123130
kb.threadContinue = True
124131
kb.threadException = False
@@ -154,14 +161,14 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
154161
infoMsg = "starting %d threads" % numThreads
155162
logger.info(infoMsg)
156163
else:
157-
threadFunction()
164+
_threadFunction()
158165
return
159166

160167
kb.multiThreadMode = True
161168

162169
# Start the threads
163170
for numThread in xrange(numThreads):
164-
thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[threadFunction])
171+
thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[_threadFunction])
165172

166173
setDaemon(thread)
167174

lib/utils/hashdb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def close(self):
6262
threadData = getCurrentThreadData()
6363
try:
6464
if threadData.hashDBCursor:
65+
threadData.hashDBCursor.connection.commit()
6566
threadData.hashDBCursor.close()
6667
threadData.hashDBCursor.connection.close()
6768
threadData.hashDBCursor = None

0 commit comments

Comments
 (0)