mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Fixing MsSQL FOR JSON handling of NULL values
This commit is contained in:
parent
0ab84074f7
commit
18e06c6381
3 changed files with 73 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.7.215"
|
||||
VERSION = "1.10.7.216"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,8 @@ def _oneShotUnionUse(expression, unpack=True, limited=False):
|
|||
if fields:
|
||||
parts = []
|
||||
for row in json_data:
|
||||
parts.append("%s%s%s" % (kb.chars.start, kb.chars.delimiter.join(getUnicode(row.get(field) or NULL) for field in fields), kb.chars.stop))
|
||||
# is-None (not falsy) check: a real 0 / '' / False are values, only JSON null is NULL
|
||||
parts.append("%s%s%s" % (kb.chars.start, kb.chars.delimiter.join(NULL if row.get(field) is None else getUnicode(row.get(field)) for field in fields), kb.chars.stop))
|
||||
retVal = "".join(parts)
|
||||
except:
|
||||
retVal = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue