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

Skip to content

Commit 044f05e

Browse files
committed
Fixes #2246
1 parent 6f34308 commit 044f05e

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

lib/core/common.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -931,15 +931,26 @@ def dataToOutFile(filename, data):
931931
retVal = None
932932

933933
if data:
934-
retVal = os.path.join(conf.filePath, filePathToSafeString(filename))
934+
while True:
935+
retVal = os.path.join(conf.filePath, filePathToSafeString(filename))
935936

936-
try:
937-
with open(retVal, "w+b") as f: # has to stay as non-codecs because data is raw ASCII encoded data
938-
f.write(unicodeencode(data))
939-
except IOError, ex:
940-
errMsg = "something went wrong while trying to write "
941-
errMsg += "to the output file ('%s')" % getSafeExString(ex)
942-
raise SqlmapGenericException(errMsg)
937+
try:
938+
with open(retVal, "w+b") as f: # has to stay as non-codecs because data is raw ASCII encoded data
939+
f.write(unicodeencode(data))
940+
except UnicodeEncodeError, ex:
941+
_ = normalizeUnicode(filename)
942+
if filename != _:
943+
filename = _
944+
else:
945+
errMsg = "couldn't write to the "
946+
errMsg += "output file ('%s')" % getSafeExString(ex)
947+
raise SqlmapGenericException(errMsg)
948+
except IOError, ex:
949+
errMsg = "something went wrong while trying to write "
950+
errMsg += "to the output file ('%s')" % getSafeExString(ex)
951+
raise SqlmapGenericException(errMsg)
952+
else:
953+
break
943954

944955
return retVal
945956

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.0.10.56"
22+
VERSION = "1.0.10.57"
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
@@ -26,7 +26,7 @@ ec007a1424da78cfdae90da6ae49ed9b lib/controller/handler.py
2626
cc9c82cfffd8ee9b25ba3af6284f057e lib/controller/__init__.py
2727
04f16204c899438dc7599a9a8426bfee lib/core/agent.py
2828
eb0bd28b0bd9fbf67dcc3119116df377 lib/core/bigarray.py
29-
8d32e43491ab8d7082dadd3155e6a9fb lib/core/common.py
29+
136246c879e7a15309ed892ea4c1c3eb lib/core/common.py
3030
5680d0c446a3bed5c0f2a0402d031557 lib/core/convert.py
3131
e77cca1cb063016f71f6e6bdebf4ec73 lib/core/data.py
3232
1d042f0bc0557d3fd564ea5a46deb77e lib/core/datatype.py
@@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
af794f90e9c1a317e3a2873b0e10a40f lib/core/settings.py
48+
a26c40b76c7ec1f18b004790c31bdbeb lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
c3ace7874a536d801f308cf1fd03df99 lib/core/target.py

0 commit comments

Comments
 (0)