Skip to content

Commit 95bd377

Browse files
committed
Minor patch
1 parent bb73c60 commit 95bd377

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

data/txt/sha256sums.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
21cbf071e8752c04eca28c61ff950acfdfdc711a787c74a6687090ab269deb29 lib/core/settings.py
191+
7f1468012119e0c214902a13b23a6a815dd07622794c445c1aa0739d762835a7 lib/core/settings.py
192192
1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py
193193
4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py
194194
cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py
@@ -220,7 +220,7 @@ fcab35db1da4ac11d8c5b8291f9c87b8d7bb073c460c438374bc5a71ce5c65a6 lib/request/in
220220
03490bed87a54bf6c42a33ac1a66f7f8504c2398534a211e7e9306f408cd506a lib/request/methodrequest.py
221221
eba8b1638c0c19d497dcbab86c9508b2ce870551b16a40db752a13c697d7d267 lib/request/pkihandler.py
222222
6336a6aba124905dab3e5ff67f76cf9b735c2a2879cc3bc8951cb06bea125895 lib/request/rangehandler.py
223-
d6ab6436d7330278081ed21433ab18e5ef74b4d7af7ccb175ae956c245c13ce1 lib/request/redirecthandler.py
223+
915fd182bdeed7ca52fdb8848d2a928abf9937a8062b30f9942c69f56a572562 lib/request/redirecthandler.py
224224
3157d66bb021b71b2e71e355b209578d15f83000f0655bcf0cd7c7eed5d4669b lib/request/templates.py
225225
5f5680c5b1db48ed2a13f47ba9de8b816d9d4f7f4c7abd07a48eb7ecbe9cf3ca lib/takeover/abstraction.py
226226
250782249ee5afbcf3f398c596edbc3a9a1b35b3e11ac182678f6e22c1449852 lib/takeover/icmpsh.py

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.41"
22+
VERSION = "1.9.12.42"
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/redirecthandler.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from lib.request.basic import decodePage
3434
from lib.request.basic import parseResponse
3535
from thirdparty import six
36+
from thirdparty.six.moves import http_client as _http_client
3637
from thirdparty.six.moves import urllib as _urllib
3738

3839
class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
@@ -67,7 +68,12 @@ def _ask_redirect_choice(self, redcode, redurl, method):
6768
self.redirect_request = self._redirect_request
6869

6970
def _redirect_request(self, req, fp, code, msg, headers, newurl):
70-
return _urllib.request.Request(newurl.replace(' ', '%20'), data=req.data, headers=req.headers, origin_req_host=req.get_origin_req_host() if hasattr(req, "get_origin_req_host") else req.origin_req_host)
71+
retVal = _urllib.request.Request(newurl.replace(' ', '%20'), data=req.data, headers=req.headers, origin_req_host=req.get_origin_req_host() if hasattr(req, "get_origin_req_host") else req.origin_req_host)
72+
73+
if hasattr(req, "redirect_dict"):
74+
retVal.redirect_dict = req.redirect_dict
75+
76+
return retVal
7177

7278
def http_error_302(self, req, fp, code, msg, headers):
7379
start = time.time()
@@ -78,7 +84,10 @@ def http_error_302(self, req, fp, code, msg, headers):
7884
try:
7985
content = fp.fp.read(MAX_CONNECTION_TOTAL_SIZE)
8086
fp.fp = io.BytesIO(content)
81-
except: # e.g. IncompleteRead
87+
except _http_client.IncompleteRead as ex:
88+
content = ex.partial
89+
fp.fp = io.BytesIO(content)
90+
except:
8291
content = b""
8392

8493
content = decodePage(content, headers.get(HTTP_HEADER.CONTENT_ENCODING), headers.get(HTTP_HEADER.CONTENT_TYPE))

0 commit comments

Comments
 (0)