Skip to content

Commit c95f67c

Browse files
committed
Minor improvements
1 parent 673a7a5 commit c95f67c

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

data/txt/sha256sums.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ eed1db5da17eca4c65a8f999166e2246eef84397687ae820bbe4984ef65a09df extra/vulnserv
166166
4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/controller/__init__.py
167167
216c9399853b7454d36dcb552baf9f1169ec7942897ddc46504684325cb6ce00 lib/core/agent.py
168168
fbba89420acafcdb9ba1a95428cf2161b13cfa2d1a7ad7d5e70c14b0e04861f0 lib/core/bigarray.py
169-
b7004d6b58ad638ac680d098aa96c07d0b403fb54f1938585fba3d61a262ff37 lib/core/common.py
169+
567c53222bc59f2aaba97ce9ba7613848ff0609007cc5dfc57051da34d76e41b lib/core/common.py
170170
11c748cc96ea2bc507bc6c1930a17fe4bc6fdd2dd2a80430df971cb21428eb00 lib/core/compat.py
171171
34bcabad7602d6a5b79a517af8a71cc2bf21e34dfe695f9f8b9c41583a37aaef lib/core/convert.py
172172
ae500647c4074681749735a4f3b17b7eca44868dd3f39f9cab0a575888ba04a1 lib/core/data.py
173173
ffae7cfe9f9afb92e887b9a8dbc1630d0063e865f35984ae417b04a4513e5024 lib/core/datatype.py
174-
38d30ecb10783f0ff58a255c801db8324ef2ac23516c7600a9e177b459d99750 lib/core/decorators.py
174+
322978f03cd69f7c98f2ea2cbe7567ab4f386b6c0548dcdf09064a6e9c393383 lib/core/decorators.py
175175
d573a37bb00c8b65f75b275aa92549683180fb209b75fd0ff3870e3848939900 lib/core/defaults.py
176176
bb7e6521edad1cbfffa89fd7d5e255ed4ff148d984ffadbeac8d42baa2d76dea lib/core/dicts.py
177177
20a6edda1d57a7564869e366f57ed7b2ab068dd8716cf7a10ef4a02d154d6c80 lib/core/dump.py
@@ -188,7 +188,7 @@ c4bfb493a03caf84dd362aec7c248097841de804b7413d0e1ecb8a90c8550bc0 lib/core/readl
188188
d1bd70c1a55858495c727fbec91e30af267459c8f64d50fabf9e4ee2c007e920 lib/core/replication.py
189189
1d0f80b0193ac5204527bfab4bde1a7aee0f693fd008e86b4b29f606d1ef94f3 lib/core/revision.py
190190
d2eb8e4b05ac93551272b3d4abfaf5b9f2d3ac92499a7704c16ed0b4f200db38 lib/core/session.py
191-
a3da2c5bdbed5f80159db0bf6324f2c818aaa4a0a18f703ca3d7b9f7aef95891 lib/core/settings.py
191+
2913a56b7d556e351ba919299a7fc40f6fe9a44239ce0d7cdf657d5c25c6e7fb lib/core/settings.py
192192
1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py
193193
4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py
194194
cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py

lib/core/common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5017,6 +5017,10 @@ def extractExpectedValue(value, expected):
50175017
50185018
>>> extractExpectedValue(['1'], EXPECTED.BOOL)
50195019
True
5020+
>>> extractExpectedValue(['17'], EXPECTED.BOOL)
5021+
True
5022+
>>> extractExpectedValue(['0'], EXPECTED.BOOL)
5023+
False
50205024
>>> extractExpectedValue('1', EXPECTED.INT)
50215025
1
50225026
>>> extractExpectedValue('7\\xb9645', EXPECTED.INT) is None
@@ -5037,10 +5041,10 @@ def extractExpectedValue(value, expected):
50375041
value = value == "true"
50385042
elif value in ('t', 'f'):
50395043
value = value == 't'
5040-
elif value in ("1", "-1"):
5041-
value = True
50425044
elif value == '0':
50435045
value = False
5046+
elif re.search(r"\A-?[1-9]\d*\Z", value):
5047+
value = True
50445048
else:
50455049
value = None
50465050
elif expected == EXPECTED.INT:

lib/core/decorators.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,21 @@ def _f(*args, **kwargs):
4949
)
5050
try:
5151
key = struct.unpack(">Q", hashlib.md5("`".join(parts).encode(UNICODE_ENCODING)).digest()[:8])[0] & 0x7fffffffffffffff
52-
except ValueError: # https://github.com/sqlmapproject/sqlmap/issues/4281 (NOTE: non-standard Python behavior where hexdigest returns binary value)
52+
except (struct.error, ValueError): # https://github.com/sqlmapproject/sqlmap/issues/4281 (NOTE: non-standard Python behavior where hexdigest returns binary value)
5353
result = f(*args, **kwargs)
5454
else:
5555
lock, cache = _method_locks[f], _cache[f]
56+
57+
with lock:
58+
if key in cache:
59+
return cache[key]
60+
61+
result = f(*args, **kwargs)
62+
5663
with lock:
57-
try:
58-
result = cache[key]
59-
except KeyError:
60-
result = f(*args, **kwargs)
61-
cache[key] = result
64+
cache[key] = result
65+
66+
return result
6267

6368
return result
6469

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from thirdparty import six
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.9.12.23"
22+
VERSION = "1.9.12.24"
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)

0 commit comments

Comments
 (0)