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

Skip to content

Commit a2a73b8

Browse files
committed
Fixes #4366
1 parent 210a4c3 commit a2a73b8

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,8 @@ def safeStringFormat(format_, params):
20712071
20722072
>>> safeStringFormat('SELECT foo FROM %s LIMIT %d', ('bar', '1'))
20732073
'SELECT foo FROM bar LIMIT 1'
2074+
>>> safeStringFormat("SELECT foo FROM %s WHERE name LIKE '%susan%' LIMIT %d", ('bar', '1'))
2075+
"SELECT foo FROM bar WHERE name LIKE '%susan%' LIMIT 1"
20742076
"""
20752077

20762078
if format_.count(PAYLOAD_DELIMITER) == 2:
@@ -2114,7 +2116,10 @@ def safeStringFormat(format_, params):
21142116
warnMsg += "Please report by e-mail content \"%r | %r | %r\" to '%s'" % (format_, params, retVal, DEV_EMAIL_ADDRESS)
21152117
raise SqlmapValueException(warnMsg)
21162118
else:
2117-
retVal = re.sub(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>" % params[count], retVal, 1)
2119+
try:
2120+
retVal = re.sub(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>" % params[count], retVal, 1)
2121+
except re.error:
2122+
retVal = retVal.replace(match.group(0), match.group(0) % params[count], 1)
21182123
count += 1
21192124
else:
21202125
break

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.10.0"
21+
VERSION = "1.4.10.1"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)