@@ -1801,6 +1801,9 @@ def _cleanupOptions():
18011801 conf .dbms = dbms if conf .dbms and ',' not in conf .dbms else None
18021802 break
18031803
1804+ if conf .uValues :
1805+ conf .uCols = "%d-%d" % (1 + conf .uValues .count (',' ), 1 + conf .uValues .count (',' ))
1806+
18041807 if conf .testFilter :
18051808 conf .testFilter = conf .testFilter .strip ('*+' )
18061809 conf .testFilter = re .sub (r"([^.])([*+])" , r"\g<1>.\g<2>" , conf .testFilter )
@@ -2582,6 +2585,10 @@ def _basicOptionValidation():
25822585 errMsg = "switch '--text-only' is incompatible with switch '--null-connection'"
25832586 raise SqlmapSyntaxException (errMsg )
25842587
2588+ if conf .uValues and conf .uChar :
2589+ errMsg = "option '--union-values' is incompatible with option '--union-char'"
2590+ raise SqlmapSyntaxException (errMsg )
2591+
25852592 if conf .base64Parameter and conf .tamper :
25862593 errMsg = "option '--base64' is incompatible with option '--tamper'"
25872594 raise SqlmapSyntaxException (errMsg )
@@ -2804,6 +2811,11 @@ def _basicOptionValidation():
28042811 errMsg = "option '--dump-format' accepts one of following values: %s" % ", " .join (getPublicTypeMembers (DUMP_FORMAT , True ))
28052812 raise SqlmapSyntaxException (errMsg )
28062813
2814+ if conf .uValues and (not re .search (r"\A['\w\s.,()%s-]+\Z" % CUSTOM_INJECTION_MARK_CHAR , conf .uValues ) or conf .uValues .count (CUSTOM_INJECTION_MARK_CHAR ) != 1 ):
2815+ errMsg = "option '--union-values' must contain valid UNION column values, along with the injection position "
2816+ errMsg += "(e.g. 'NULL,1,%s,NULL')" % CUSTOM_INJECTION_MARK_CHAR
2817+ raise SqlmapSyntaxException (errMsg )
2818+
28072819 if conf .skip and conf .testParameter :
28082820 if intersect (conf .skip , conf .testParameter ):
28092821 errMsg = "option '--skip' is incompatible with option '-p'"
0 commit comments