Skip to content

Commit 1ef2c40

Browse files
committed
Patch for an Issue sqlmapproject#892
1 parent a4d058d commit 1ef2c40

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,13 @@ def dataToOutFile(filename, data):
857857
if data:
858858
retVal = os.path.join(conf.filePath, filePathToSafeString(filename))
859859

860-
with codecs.open(retVal, "wb", UNICODE_ENCODING) as f:
861-
f.write(data)
860+
try:
861+
with codecs.open(retVal, "wb", UNICODE_ENCODING) as f:
862+
f.write(data)
863+
except IOError, ex:
864+
errMsg = "something went wrong while trying to write "
865+
errMsg += "to the output file ('%s')" % ex
866+
raise SqlmapGenericException(errMsg)
862867

863868
return retVal
864869

0 commit comments

Comments
 (0)