File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55See the file 'doc/COPYING' for copying permission
66"""
77
8+ import httplib
89import re
910
1011from lib .core .common import readInput
1112from lib .core .data import kb
1213from lib .core .data import logger
14+ from lib .core .exception import SqlmapSyntaxException
1315from lib .request .connect import Connect as Request
1416from thirdparty .oset .pyoset import oset
1517
@@ -26,8 +28,13 @@ def parseSitemap(url, retVal=None):
2628 abortedFlag = False
2729 retVal = oset ()
2830
29- content = Request .getPage (url = url , raise404 = True )[0 ] if not abortedFlag else ""
30- for match in re .finditer (r"<loc>\s*([^<]+)" , content ):
31+ try :
32+ content = Request .getPage (url = url , raise404 = True )[0 ] if not abortedFlag else ""
33+ except httplib .InvalidURL :
34+ errMsg = "invalid URL given for sitemap ('%s')" % url
35+ raise SqlmapSyntaxException , errMsg
36+
37+ for match in re .finditer (r"<loc>\s*([^<]+)" , content or "" ):
3138 if abortedFlag :
3239 break
3340 url = match .group (1 ).strip ()
You can’t perform that action at this time.
0 commit comments