Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b231f8

Browse files
committed
Minor bug fix (regarding Issue #379) - in case that two processes enter the same proc_count decrementing line sqlmap would halt
1 parent 8138d13 commit 9b231f8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/utils/hash.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
516516

517517
finally:
518518
if hasattr(proc_count, "value"):
519-
proc_count.value -= 1
519+
with proc_count.get_lock():
520+
proc_count.value -= 1
520521

521522
def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found, proc_id, proc_count, wordlists, custom_wordlist):
522523
count = 0
@@ -586,7 +587,8 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
586587

587588
finally:
588589
if hasattr(proc_count, "value"):
589-
proc_count.value -= 1
590+
with proc_count.get_lock():
591+
proc_count.value -= 1
590592

591593
def dictionaryAttack(attack_dict):
592594
suffix_list = [""]

0 commit comments

Comments
 (0)