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 {
4141private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod {
4242 SystemConsoleAndSystemIoTextWriterFormatMethods ( ) {
4343 this .getParameter ( 0 ) .getType ( ) instanceof StringType and
44+ this .getNumberOfParameters ( ) > 1 and
4445 exists ( Class declType | declType = this .getDeclaringType ( ) |
4546 this .hasName ( [ "Write" , "WriteLine" ] ) and
4647 (
@@ -67,6 +68,7 @@ private class SystemDiagnosticsDebugAssert extends FormatMethod {
6768private class SystemDiagnosticsFormatMethods extends FormatMethod {
6869 SystemDiagnosticsFormatMethods ( ) {
6970 this .getParameter ( 0 ) .getType ( ) instanceof StringType and
71+ this .getNumberOfParameters ( ) > 1 and
7072 exists ( Class declType |
7173 declType = this .getDeclaringType ( ) and
7274 declType .getNamespace ( ) .getFullName ( ) = "System.Diagnostics"
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ private predicate invalidFormatString(
2929 source .getNode ( ) .asExpr ( ) = src and
3030 sink .getNode ( ) .asExpr ( ) = call .getFormatExpr ( ) and
3131 FormatInvalid:: flowPath ( source , sink ) and
32- call .hasInsertions ( ) and
3332 msg = "Invalid format string used in $@ formatting call." and
3433 callString = "this"
3534}
You can’t perform that action at this time.
0 commit comments