Java: Add example of missing sink generation.

This commit is contained in:
Michael Nebel
2024-08-14 09:45:54 +02:00
parent 6f79480b40
commit 046018fa25
2 changed files with 15 additions and 0 deletions

View File

@@ -7,6 +7,13 @@ extensions:
- [ "p", "Sinks", False, "sink", "(Object)", "", "Argument[0]", "test-sink", "manual" ]
- [ "p", "Sinks", False, "sink2", "(Object)", "", "Argument[0]", "test-sink2", "manual" ]
- [ "p", "Sinks", False, "manualSinkAlreadyDefined", "(Object)", "", "Argument[0]", "test-sink", "manual" ]
- [ "p", "Sinks", False, "saveAndGet", "(Object)", "", "Argument[0]", "test-sink", "df-generated"]
- addsTo:
pack: codeql/java-all
extensible: sourceModel
data:
- [ "p", "Sinks", False, "saveAndGet", "(Object)", "", "ReturnValue", "test-source", "manual"]
- addsTo:
pack: codeql/java-all

View File

@@ -25,6 +25,14 @@ public class Sinks {
// neutral=p;Sinks;nosink;(Object);summary;df-generated
public void nosink(Object o) {}
// Sink and Source defined in the extensible file next to the sink test.
// MISSING SINK
// neutral=p;Sinks;saveAndGet;(Object);summary;df-generated
public Object saveAndGet(Object o) {
sink(o);
return null;
}
// 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