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

Skip to content

Commit 907786e

Browse files
committed
Patch for #4314
1 parent 85b73f8 commit 907786e

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

lib/core/patch.py

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

88
import codecs
9+
import os
910
import random
1011

1112
import lib.controller.checks
@@ -76,6 +77,15 @@ def _(self, *args):
7677
# to prevent too much "guessing" in case of binary data retrieval
7778
thirdparty.chardet.universaldetector.MINIMUM_THRESHOLD = 0.90
7879

80+
# https://github.com/sqlmapproject/sqlmap/issues/4314
81+
try:
82+
os.urandom(1)
83+
except NotImplemented:
84+
if six.PY3:
85+
os.urandom = lambda size: bytes(random.randint(0, 255) for _ in range(size))
86+
else:
87+
os.urandom = lambda size: "".join(chr(random.randint(0, 255)) for _ in xrange(size))
88+
7989
def resolveCrossReferences():
8090
"""
8191
Place for cross-reference resolution

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.8.11"
21+
VERSION = "1.4.8.12"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
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)