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

Skip to content

Commit 69cdad4

Browse files
committed
Patch for an Issue #958
1 parent 28d6af6 commit 69cdad4

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,10 +992,22 @@ def sanitizeStr(value):
992992

993993
def checkFile(filename):
994994
"""
995-
Checks for file existence
995+
Checks for file existence and readability
996996
"""
997997

998+
valid = True
999+
9981000
if filename is None or not os.path.isfile(filename):
1001+
valid = False
1002+
1003+
if valid:
1004+
try:
1005+
with open(filename, "rb") as f:
1006+
pass
1007+
except:
1008+
valid = False
1009+
1010+
if not valid:
9991011
raise SqlmapSystemException("unable to read file '%s'" % filename)
10001012

10011013
def banner():

0 commit comments

Comments
 (0)