mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#/Java: Add test for missing neutral summary generation.
This commit is contained in:
@@ -4,3 +4,5 @@ extensions:
|
||||
extensible: neutralModel
|
||||
data:
|
||||
- [ "Models", "ManuallyModelled", "HasNeutralSummaryNoFlow", "(System.Object)", "summary", "manual"]
|
||||
- [ "Sinks", "NewSinks", "NoSink", "(System.Object)", "summary", "df-generated"]
|
||||
- [ "Sinks", "NewSinks", "NoSink", "(System.Object)", "sink", "manual"]
|
||||
|
||||
@@ -20,6 +20,10 @@ public class NewSinks
|
||||
// neutral=Sinks;NewSinks;Sink2;(System.Object);summary;df-generated
|
||||
public static void Sink2(object o) => throw null;
|
||||
|
||||
// Defined as sink neutral in the file next to the neutral summary test.
|
||||
// MISSING NEUTRAL
|
||||
public static void NoSink(object o) => throw null;
|
||||
|
||||
// New sink
|
||||
// sink=Sinks;NewSinks;false;WrapResponseWrite;(System.Object);;Argument[0];html-injection;df-generated
|
||||
// neutral=Sinks;NewSinks;WrapResponseWrite;(System.Object);summary;df-generated
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/java-all
|
||||
extensible: neutralModel
|
||||
data:
|
||||
- [ "p", "Sinks", "nosink", "(Object)", "sink", "manual"]
|
||||
- [ "p", "Sinks", "nosink", "(Object)", "summary", "df-generated"]
|
||||
@@ -21,6 +21,11 @@ public class Sinks {
|
||||
// neutral=p;Sinks;sink2;(Object);summary;df-generated
|
||||
public void sink2(Object o) {}
|
||||
|
||||
// Defined as sink neutral file in the model file next to the
|
||||
// neutral test.
|
||||
// MISSING NEUTRAL.
|
||||
public void nosink(Object o) {}
|
||||
|
||||
// sink=p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[0];path-injection;df-generated
|
||||
// sink=p;Sinks;true;copyFileToDirectory;(Path,Path,CopyOption[]);;Argument[1];path-injection;df-generated
|
||||
// neutral=p;Sinks;copyFileToDirectory;(Path,Path,CopyOption[]);summary;df-generated
|
||||
|
||||
Reference in New Issue
Block a user