File tree 4 files changed +44
-0
lines changed
csharp/ql/test/library-tests/standalone/externalLocationSink
4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ #select
2
+ compilationErrors
3
+ | standalone.cs:16:12:16:18 | CS0104: 'ILogger' is an ambiguous reference between 'A.ILogger' and 'B.ILogger' |
4
+ methodCalls
5
+ | standalone.cs:20:9:20:21 | call to method |
6
+ | standalone.cs:25:9:25:33 | call to method |
Original file line number Diff line number Diff line change
1
+ import semmle.code.csharp.security.dataflow.flowsinks.ExternalLocationSink
2
+ import semmle.code.csharp.commons.Diagnostics
3
+
4
+ from ExternalLocationSink sink
5
+ where sink .getLocation ( ) .getFile ( ) .fromSource ( )
6
+ select sink , sink .getExpr ( )
7
+
8
+ query predicate compilationErrors ( CompilerError e ) { any ( ) }
9
+
10
+ query predicate methodCalls ( MethodCall m ) { any ( ) }
Original file line number Diff line number Diff line change
1
+ semmle-extractor-options: --standalone
Original file line number Diff line number Diff line change
1
+ using A ;
2
+ using B ;
3
+
4
+ namespace A
5
+ {
6
+ public interface ILogger { }
7
+ }
8
+
9
+ namespace B
10
+ {
11
+ public interface ILogger { }
12
+ }
13
+
14
+ public class C
15
+ {
16
+ public ILogger logger ;
17
+
18
+ private void M ( string s )
19
+ {
20
+ logger . Log ( s ) ;
21
+ }
22
+
23
+ private static void Main ( )
24
+ {
25
+ new C ( ) . logger . Log ( "abc" ) ;
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments