Skip to content

Commit e7e23d1

Browse files
committed
fix for a Ctrl+C bug reported by nightman@email.de
1 parent 26062ec commit e7e23d1

3 files changed

Lines changed: 13 additions & 15 deletions

File tree

doc/THANKS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ mitchell <mitchell@tufala.net>
517517
for reporting a bug
518518

519519
nightman <nightman@email.de>
520-
for reporting several bugs
520+
for reporting considerable amount of bugs
521521

522522
pacman730 <pacman730@users.sourceforge.net>
523523
for reporting a bug

lib/techniques/error/use.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
319319
stopLimit = 1
320320

321321
try:
322+
threadData = getCurrentThreadData()
323+
numThreads = min(conf.threads, stopLimit-startLimit)
324+
threadData.shared.limits = range(startLimit, stopLimit)
325+
threadData.shared.outputs = []
326+
322327
if stopLimit > TURN_OFF_RESUME_INFO_LIMIT:
323328
kb.suppressResumeInfo = True
324329
infoMsg = "suppressing possible resume console info because of "
@@ -329,11 +334,6 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
329334
for lock in lockNames:
330335
kb.locks[lock] = threading.Lock()
331336

332-
threadData = getCurrentThreadData()
333-
numThreads = min(conf.threads, stopLimit-startLimit)
334-
threadData.shared.limits = range(startLimit, stopLimit)
335-
threadData.shared.outputs = []
336-
337337
def errorThread():
338338
threadData = getCurrentThreadData()
339339

@@ -361,8 +361,6 @@ def errorThread():
361361

362362
runThreads(numThreads, errorThread)
363363

364-
outputs = threadData.shared.outputs
365-
366364
except KeyboardInterrupt:
367365
warnMsg = "user aborted during enumeration. sqlmap "
368366
warnMsg += "will display partial output"
@@ -375,6 +373,7 @@ def errorThread():
375373
logger.critical(errMsg)
376374

377375
finally:
376+
outputs = threadData.shared.outputs
378377
kb.suppressResumeInfo = False
379378

380379
if not outputs:

lib/techniques/inband/union/use.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ def unionUse(expression, unpack=True, dump=False):
259259
stopLimit = 1
260260

261261
try:
262+
threadData = getCurrentThreadData()
263+
numThreads = min(conf.threads, stopLimit-startLimit)
264+
threadData.shared.limits = range(startLimit, stopLimit)
265+
threadData.shared.value = ""
266+
262267
if stopLimit > TURN_OFF_RESUME_INFO_LIMIT:
263268
kb.suppressResumeInfo = True
264269
infoMsg = "suppressing possible resume console info because of "
@@ -269,11 +274,6 @@ def unionUse(expression, unpack=True, dump=False):
269274
for lock in lockNames:
270275
kb.locks[lock] = threading.Lock()
271276

272-
threadData = getCurrentThreadData()
273-
numThreads = min(conf.threads, stopLimit-startLimit)
274-
threadData.shared.limits = range(startLimit, stopLimit)
275-
threadData.shared.value = ""
276-
277277
def unionThread():
278278
threadData = getCurrentThreadData()
279279

@@ -325,8 +325,6 @@ def unionThread():
325325

326326
runThreads(numThreads, unionThread)
327327

328-
value = threadData.shared.value
329-
330328
if conf.verbose == 1:
331329
clearConsoleLine(True)
332330

@@ -342,6 +340,7 @@ def unionThread():
342340
logger.critical(errMsg)
343341

344342
finally:
343+
value = threadData.shared.value
345344
kb.suppressResumeInfo = False
346345

347346
if not value:

0 commit comments

Comments
 (0)