Skip to content

Commit bc1fbc5

Browse files
committed
Potential patch for #2847
1 parent cad6cfe commit bc1fbc5

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

lib/core/decorators.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
See the file 'LICENSE' for copying permission
66
"""
77

8+
import hashlib
9+
810
def cachedmethod(f, cache={}):
911
"""
1012
Method with a cached content
@@ -13,14 +15,9 @@ def cachedmethod(f, cache={}):
1315
"""
1416

1517
def _(*args, **kwargs):
16-
try:
17-
key = hash((f, tuple(args), frozenset(kwargs.items())))
18-
if key not in cache:
19-
cache[key] = f(*args, **kwargs)
20-
except:
21-
key = hash("".join(str(_) for _ in (f, args, kwargs)))
22-
if key not in cache:
23-
cache[key] = f(*args, **kwargs)
18+
key = int(hashlib.md5("".join(str(_) for _ in (f, args, kwargs))).hexdigest()[:8], 16)
19+
if key not in cache:
20+
cache[key] = f(*args, **kwargs)
2421

2522
return cache[key]
2623

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

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

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ d2cdb9e832e18a81e936ca3348144b16 lib/controller/handler.py
3131
5c918135b3776bb129edbfdd422ece1b lib/core/convert.py
3232
90b1b08368ac8a859300e6fa6a8c796e lib/core/data.py
3333
1c14bdbf47b8dba31f73da9ad731a54a lib/core/datatype.py
34-
2c16cdbbccbfcfc0ddac2cff876ce9f3 lib/core/decorators.py
34+
a73da01cee9d00ba385b05adc4903037 lib/core/decorators.py
3535
d3ed5f9baa074df33390d33164d9d8b5 lib/core/defaults.py
3636
1c428d1b036ff81b459121a0e57925c9 lib/core/dicts.py
3737
956be8ca65c7f04f08c6f2dce710b3b2 lib/core/dump.py
@@ -46,7 +46,7 @@ f872699e948d0692ce11b54781da814c lib/core/log.py
4646
760d9df2a27ded29109b390ab202e72d lib/core/replication.py
4747
a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
4848
02d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49-
1f35b3da2c4497b5fb39f50a6d8e0738 lib/core/settings.py
49+
c9d7d58cff59c79667e150b3fd6bcd6c lib/core/settings.py
5050
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252
d93501771b41315f9fb949305b6ed257 lib/core/target.py

0 commit comments

Comments
 (0)