File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
lib/semmle/code/csharp/frameworks Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod {
41
41
private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod {
42
42
SystemConsoleAndSystemIoTextWriterFormatMethods ( ) {
43
43
this .getParameter ( 0 ) .getType ( ) instanceof StringType and
44
+ this .getNumberOfParameters ( ) > 1 and
44
45
exists ( Class declType | declType = this .getDeclaringType ( ) |
45
46
this .hasName ( [ "Write" , "WriteLine" ] ) and
46
47
(
@@ -67,6 +68,7 @@ private class SystemDiagnosticsDebugAssert extends FormatMethod {
67
68
private class SystemDiagnosticsFormatMethods extends FormatMethod {
68
69
SystemDiagnosticsFormatMethods ( ) {
69
70
this .getParameter ( 0 ) .getType ( ) instanceof StringType and
71
+ this .getNumberOfParameters ( ) > 1 and
70
72
exists ( Class declType |
71
73
declType = this .getDeclaringType ( ) and
72
74
declType .getNamespace ( ) .getFullName ( ) = "System.Diagnostics"
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ private predicate invalidFormatString(
29
29
source .getNode ( ) .asExpr ( ) = src and
30
30
sink .getNode ( ) .asExpr ( ) = call .getFormatExpr ( ) and
31
31
FormatInvalid:: flowPath ( source , sink ) and
32
- call .hasInsertions ( ) and
33
32
msg = "Invalid format string used in $@ formatting call." and
34
33
callString = "this"
35
34
}
You can’t perform that action at this time.
0 commit comments