You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Data/ReviewSQLQueriesForSecurityVulnerabilitiesTests_FlowAnalysis.cs
string str = t.B.Field; // t.B now points to either b or d, both of which have .Field = """"
3394
+
// However, we are forced to be conservative in our analysis due to
3395
+
// potential false positives from multiple variables pointing to the same set, i.e. b or d.
3396
+
// See https://github.com/dotnet/roslyn-analyzers/issues/6520 for an example.
3392
3397
Command c = new Command1(str, str);
3393
3398
}}
3394
-
}}
3395
-
");
3399
+
}}",
3400
+
ExpectedDiagnostics=
3401
+
{
3402
+
// /0/Test0.cs(126,21): warning CA2100: Review if the query string passed to 'Command1.Command1(string cmd, string parameter2)' in 'M1', accepts any user input
Dim str As String = t.B.Field ' t.B now points to either b or d, both of which have .Field = """"
3444
+
' However, we are forced to be conservative in our analysis due to
3445
+
' potential false positives from multiple variables pointing to the same set, i.e. b or d.
3446
+
' See https://github.com/dotnet/roslyn-analyzers/issues/6520 for an example.
3432
3447
Dim c As Command = New Command1(str, str)
3433
3448
End Sub
3434
-
End Class");
3449
+
End Class",
3450
+
ExpectedDiagnostics=
3451
+
{
3452
+
// /0/Test0.vb(159,28): warning CA2100: Review if the query string passed to 'Sub Command1.New(cmd As String, parameter2 As String)' in 'M1', accepts any user input
3453
+
GetBasicResultAt(159,28,"Sub Command1.New(cmd As String, parameter2 As String)","M1")
0 commit comments