Skip to content

Commit acd764f

Browse files
committed
Fixes #2828
1 parent 310a829 commit acd764f

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

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.16"
22+
VERSION = "1.1.12.17"
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)

lib/request/comparison.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,17 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
110110
elif isinstance(seqMatcher.a, unicode) and isinstance(page, str):
111111
seqMatcher.a = seqMatcher.a.encode(kb.pageEncoding or DEFAULT_PAGE_ENCODING, "ignore")
112112

113-
if seqMatcher.a and page and seqMatcher.a == page:
114-
ratio = 1
113+
if any(_ is None for _ in (page, seqMatcher.a)):
114+
return None
115+
elif seqMatcher.a and page and seqMatcher.a == page:
116+
ratio = 1.
115117
elif kb.skipSeqMatcher or seqMatcher.a and page and any(len(_) > MAX_DIFFLIB_SEQUENCE_LENGTH for _ in (seqMatcher.a, page)):
116-
ratio = 1.0 * len(seqMatcher.a) / len(page)
117-
if ratio > 1:
118-
ratio = 1. / ratio
118+
if not page or not seqMatcher.a:
119+
return float(seqMatcher.a == page)
120+
else:
121+
ratio = 1. * len(seqMatcher.a) / len(page)
122+
if ratio > 1:
123+
ratio = 1. / ratio
119124
else:
120125
seq1, seq2 = None, None
121126

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
6c134f0e75978056a01a6442bbef1ac8 lib/core/settings.py
49+
eed5329e23cee75adb1e14f825d29192 lib/core/settings.py
5050
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252
d93501771b41315f9fb949305b6ed257 lib/core/target.py
@@ -67,7 +67,7 @@ d8d9bcf9e7107a5e2cf2dd10f115ac28 lib/parse/payloads.py
6767
2b87577dc6d3609e96fc1e049def5b4f lib/parse/sitemap.py
6868
d2f13a0e2fef5273d419d06e516122e1 lib/request/basicauthhandler.py
6969
4f8b3d682093fc577592e85999400149 lib/request/basic.py
70-
e0da70f14e9bff8288f14d903cfafb36 lib/request/comparison.py
70+
6ece5e32cc1496720af42a762bf8c3ee lib/request/comparison.py
7171
ae823462aad7cd1081e6609192ba3109 lib/request/connect.py
7272
ad6f76839408d827abfcdc57813f8518 lib/request/direct.py
7373
4853bd0d523646315607a6a9a4c0b745 lib/request/dns.py

0 commit comments

Comments
 (0)