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

Skip to content

Commit 305d798

Browse files
committed
Fixes #5619
1 parent acd9831 commit 305d798

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

lib/core/datatype.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import copy
9+
import threading
910
import types
1011

1112
from thirdparty.odict import OrderedDict
@@ -142,6 +143,7 @@ class LRUDict(object):
142143
def __init__(self, capacity):
143144
self.capacity = capacity
144145
self.cache = OrderedDict()
146+
self.__lock = threading.Lock()
145147

146148
def __len__(self):
147149
return len(self.cache)
@@ -158,11 +160,12 @@ def get(self, key):
158160
return self.__getitem__(key)
159161

160162
def __setitem__(self, key, value):
161-
try:
162-
self.cache.pop(key)
163-
except KeyError:
164-
if len(self.cache) >= self.capacity:
165-
self.cache.popitem(last=False)
163+
with self.__lock:
164+
try:
165+
self.cache.pop(key)
166+
except KeyError:
167+
if len(self.cache) >= self.capacity:
168+
self.cache.popitem(last=False)
166169
self.cache[key] = value
167170

168171
def set(self, key, value):

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.8.1.6"
23+
VERSION = "1.8.1.7"
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)

0 commit comments

Comments
 (0)