Skip to content

Commit b83f478

Browse files
committed
C#: Bugfix in the implicittostring. Need to handle the ReadOnlySpan params overload for string.Format.
1 parent 7c94dee commit b83f478

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

csharp/ql/lib/semmle/code/csharp/commons/Strings.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import csharp
6+
private import semmle.code.csharp.commons.Collections
67
private import semmle.code.csharp.frameworks.Format
78
private import semmle.code.csharp.frameworks.System
89
private import semmle.code.csharp.frameworks.system.Text
@@ -33,7 +34,7 @@ class ImplicitToStringExpr extends Expr {
3334
or
3435
p instanceof StringFormatItemParameter and
3536
not p.getType() =
36-
any(ArrayType at |
37+
any(ParamsCollectionType at |
3738
at.getElementType() instanceof ObjectType and
3839
this.getType().isImplicitlyConvertibleTo(at)
3940
)

0 commit comments

Comments
 (0)