From 9b231f87d676979a401ff2b7a0a14be74f82462b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 13 Feb 2013 15:31:50 +0100 Subject: [PATCH] Minor bug fix (regarding Issue #379) - in case that two processes enter the same proc_count decrementing line sqlmap would halt --- lib/utils/hash.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index 6d5ca49cf..bb92cf23c 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -516,7 +516,8 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc finally: if hasattr(proc_count, "value"): - proc_count.value -= 1 + with proc_count.get_lock(): + proc_count.value -= 1 def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found, proc_id, proc_count, wordlists, custom_wordlist): count = 0 @@ -586,7 +587,8 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found finally: if hasattr(proc_count, "value"): - proc_count.value -= 1 + with proc_count.get_lock(): + proc_count.value -= 1 def dictionaryAttack(attack_dict): suffix_list = [""]