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

Skip to content

Commit 2c87d06

Browse files
committed
minor update
1 parent 9ca8bc4 commit 2c87d06

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ def __urllib2Opener():
152152
conf.cj = cookielib.CookieJar()
153153
else:
154154
conf.cj = cookielib.MozillaCookieJar()
155-
conf.cj.load(conf.loC)
155+
try:
156+
conf.cj.load(conf.loC)
157+
except cookielib.LoadError, msg:
158+
errMsg = "there was a problem loading "
159+
errMsg += "cookies file ('%s')" % msg
160+
raise sqlmapGenericException, errMsg
156161

157162
handlers.append(urllib2.HTTPCookieProcessor(conf.cj))
158163

@@ -1889,6 +1894,11 @@ def __basicOptionValidation():
18891894
errMsg += "supported charsets"
18901895
raise sqlmapSyntaxException, errMsg
18911896

1897+
if conf.loC:
1898+
if not os.path.exists(conf.loC):
1899+
errMsg = "cookies file '%s' does not exist" % conf.loC
1900+
raise sqlmapFilePathException, errMsg
1901+
18921902
def __resolveCrossReferences():
18931903
lib.core.threads.readInput = readInput
18941904
lib.core.common.getPageTemplate = getPageTemplate

0 commit comments

Comments
 (0)